cancel
Showing results for 
Search instead for 
Did you mean: 

Searching files using fts-alfresco

Hoang
Champ in-the-making
Champ in-the-making

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

5 REPLIES 5

angelborroy
Community Manager Community Manager
Community Manager

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%'
Hyland Developer Evangelist

Hoang
Champ in-the-making
Champ in-the-making

Thanks ,

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"

angelborroy
Community Manager Community Manager
Community Manager

@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

Hyland Developer Evangelist

Hoang
Champ in-the-making
Champ in-the-making

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'

image

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'

image
Is this a bug?

Hoang
Champ in-the-making
Champ in-the-making

Another problem when using the "?" wildcard character.

Example:

3) Query file name starting with "28" followed by "?????.pdf". Results as expected.
image
4) Replace "28" with "??". Nothing found.

image
Any Ideas?