Hi,
I use fts-alfresco to search file name containing words starting with "my"
query: "+TYPE:content AND cm:name:'my*' AND PATH:'app:company_home/cm:Test//*'"
But I get also files, which not starting with "my"
"mydoc.xml"
"mytext.completeness.log"
"78789_my.joblog.lxml"
"1787975_my.joblog.html"
Any ideas for that?
Thanks,
Hoang
FTS is applying tokenization for "cm:name" field, so you get extra results that include "my" as token.
You can switch to CMIS Syntax, using a query similar to this one:
SELECT * FROM cmis:document WHERE cmis:name LIKE 'my%'
Thanks angelborroy,
I've found some ways to achieve that including your suggestion.
CMIS:
query: "SELECT * FROM cmis:document WHERE IN_TREE('543a5920-8b57-4f7b-8831-fab4ae39eaa0') AND cmis:name like 'my%'"
or search for an exact term using "="
query: "SELECT * FROM cmis:document WHERE IN_TREE('543a5920-8b57-4f7b-8831-fab4ae39eaa0') AND CONTAINS('=cmis:name:my*')"
AFS:
query: query: "+TYPE:content AND =cm:name:'my*' AND PATH:'app:company_home/cm:Test//*'"
Results as expected:
"mydoc.xml"
"mytext.completeness.log"
@afaust I guess this "AFS" query from last comment is one that we broke in 2.0.0...
https://issues.alfresco.com/jira/browse/SEARCH-2461
I have an other problem when using "=".
Example:
1) Query without "=". All pdf files were found. Results as expected.
Query: PATH:'/app:company_home/cm:Test//*' AND cm:name:'*.pdf'
2) Query with "=". Just only one was found. But all pdf files should be also found.
Query: PATH:'/app:company_home/cm:Test//*' AND =cm:name:'*.pdf'
Is this a bug?
Another problem when using the "?" wildcard character.
Example:
3) Query file name starting with "28" followed by "?????.pdf". Results as expected.
4) Replace "28" with "??". Nothing found.
Any Ideas?
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.