10-06-2020 06:47 AM
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
10-06-2020 07:47 AM
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%'
10-07-2020 05:54 AM
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"
10-07-2020 05:59 AM
@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
10-12-2020 02:15 AM
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?
10-12-2020 03:33 AM
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?
Explore our Alfresco products with the links below. Use labels to filter content by product module.