I tried to search documnet with its property and document name
i used following query.
I used cmis API to search records
select * from my:content where my:customnode Like '%Test' or cmis:name
Like '%Test%'
Its not working..I didn't search my record by document name..
I search record from my custom model.
If i search record by only property like my:customnode,my:address then it gives output successfully.
But When I used cmis:name then it didn't work.
How can I search document by its name??
Thanks
A common mistake is not adding a where clause for each aspect you are searching on.
If the property my:customnode (I'm guessing this is a property otherwise this is the problem) is part of an aspect you need to do a join like this:
... from my:content JOIN my:aspect as ma where ma.my:customprop like ...
Your query should work the problem is not the cmis:name column.
I just tried the following query on my repository and it worked as expected:
select * from my:DocumentDetails
where my:DocumentTitle like '%Test%'
or cmis:name like '%23%'
Unless I am missing something, this seems a problem with lucene or solr indexes.
Have you tested your query in the "Node Browser"? You can execute the same search with CMIS and with a lucene query. If it does not work with the lucene query, check your indexes.
Related
Im still new with DynamoDB , How do I query something based on the previous query result?
This is how my table look like :
I want to query for the list of project info for an user.
From my first query , the result of USER#001 have [PROJECT#001,PROJECT#002].
Then I want to get a list project detail based on the first query.
How do I make an "nested" query ?? or is there anyway there I can query more efficiently ?
*The table structure is fix, I cant change it.
You can't. That's not the way DDB works...
All you could do is a BatchGetItem() with the pk & sk for the two projects.
Or if you don't happen to know the SK, you'd need to make two individual Query() calls with the pk only.
I am working with SQLite. I need to know a query that retrieves all KEYWORDS in SQLite. Ex:
For Oracle: select * from v$reserved_words
For MySQL: select * from mysql.help_keyword
Above query will show all keywords in the corresponding database. Like this, I need a query for SQLite. Anyone knows please let me know.
There is no way to dynamically retrieve the list of reserved words, with a system table or a pragma.
The documentation lists the (currently) 124 keywords. It seems that the actual list also depends on the compile-time options.
I enjoy working with LiteDB in Xamarin.Forms. What is the best practice for getting list of objects from a table using list of ids or indexes in condition?
Currently, it looks for me like this:
_db.GetCollection<T>().FindAll().Where(q => listValues.Contains(Convert.ToInt32(q.GetProperty(idColumnName))));
listValues - list of searched ids.
idColumnName - column with indexes.
But FindAll retrives all records from LiteDB. Is there any more efficint options without full scanning?
Use the query in the Find method instead which will only retrieve entries based on your query rather than the full data set. This, according to the LiteDB's guidance, is more efficient than Linq queries on the full data returned: https://github.com/mbdavid/LiteDB/wiki/Queries
So your query would look like as follows
_d.GetCollection<T>().Find(q => listValues.Contains(Convert.ToInt32(q.GetProperty(idColumnName))))
I think you can just use collection.Query().Where("Column", 1,2,3) for this
I need to query a particular folder in the repository using a java based scheduler in alfresco.
I need to check whether the custom aspect's property is present or not.
Below query works for me when I don't use the path query.
select * from myType:caseDoc as d join myAspect:caseId as s on d.cmis:objectId = s.cmis:objectId
The problem with the above query is it searches all the contents in the repository but I want to target a particular folder.
When I try to put the CONTAINS in the above query it fails.
select * from cch:caseDoc as d
join cch:caseId as s on d.cmis:objectId = s.cmis:objectId WHERE CONTAINS('PATH:"//app:company_home/cm:FWED/cm:CDO/cm:CAB-DROP-FOLDER/*"')
It gives below exception
A selector must be specified when there are two or more selectors
Thank you
It looks like you may be missing one argument in CONTAINS(). Did you try something like this?
select *
from cch:caseDoc as d
join cch:caseId as s
on d.cmis:objectId = s.cmis:objectId
WHERE CONTAINS(d,'PATH:"//app:company_home/cm:FDLE/cm:CCH/cm:CCH-DROP-FOLDER/*"')
(I'm just putting my comment as an answer)
Well, if you are worrying about the path, then you should put
CONTAINS('PATH:"/app:company_home/cm:FWED/cm:CDO/cm:CAB-DROP-FOLDER/*"')
With one single / at the start of the path, if you which to only search in direct children to that path or :
CONTAINS('PATH:"/app:company_home/cm:FWED/cm:CDO/cm:CAB-DROP-FOLDER//*"')
to perform the lookup in the whole underlying hierarchy!
However, I do think that the query you provided and the behaviour you described does not match each other !
I am not able to search the middle part of string using fulltext search index for eg:there was a string "I like music" i was not able to search for like which is in the middle part of string..
Try LIKE operator.
SELECT
*
FROM
YourTABLE
WHERE
ColumnName LIKE '%like%'
Use Like keyword in query as follows:
select * from tablename where col like '%like%'
Here is the tutorial of like in sql:
http://www.w3schools.com/sql/sql_like.asp
Here is the MSDN:
http://msdn.microsoft.com/en-us/library/ms179859.aspx
Hope its helpful.
Well, in order to still use the fulltext index and to avoid a table scan, try this
select *
from yourTable
where contains (ColumnName,'like')
and (ColumnName not like 'like%' or ColumnName like '_%like%')
However, the query optimizer might decide that a full table scan is more effective.
Check if statistics of your table out of date, especially check the statistics relates to your fulltext index. Since you are using SQl Server 2008, so, you can query DMV to get statistics information of your index or using DBCC to see the statistics detail information
DBCC SHOW_STATISTICS ("[schema].[table]",indexname);
Check the first return result, [Updated], [rows], [rows sampled], if the statistics out of date, or [rows sampled] far less than [rows], which many cause SQL Engine decided to use table scan instead of using your index.