Searching files using fts-alfresco

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Customer

Searching files using fts-alfresco

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
Highlighted
Alfresco Employee

Re: Searching files using fts-alfresco

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%'
Software Engineer in Alfresco Search Team.
Highlighted
Customer

Re: Searching files using fts-alfresco

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"

 

 

Highlighted
Alfresco Employee

Re: Searching files using fts-alfresco

@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

 

Software Engineer in Alfresco Search Team.
Highlighted
Customer

Re: Searching files using fts-alfresco

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'

Query1.png

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'

Query2.png
Is this a bug?

 

 

 

 

 

 

Highlighted
Customer

Re: Searching files using fts-alfresco

Another problem when using the "?" wildcard character.

Example:

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

Query4.png
Any Ideas?