Hi, everyone
I have detected a strange behaviour in CMIS queries using CONTAINS() and wildcards.
For example, I have a folder named "Someco" and I want to find it by part of its name using wildcards:
SELECT * from cmis:folder WHERE CONTAINS('cmis:name:"*Some*"')
This query find the the folder as is expected, but if I add a 'o' or an 'a' to the query as:
SELECT * from cmis:folder WHERE CONTAINS('cmis:name:"*Someo*"')
The modified query find my folder too, wich is incorrect as my folder does not contains "Someo" in its name.
¿Is there any way to correct this behaviour with the syntaxis of the query?
Thanks.
Hi
I have tried to reproduce this an failed. Are you sure it is finding the same folder!
Andy
Hi, Andy
Yes, I'm sure. It's an issue related to FTS word stemming but I don't know if I can deactivate it in some way.
Thanks
Hi
It seems you are falling foul of localised stemming. The name of a document can be treated as an identifier.
SELECT * from cmis:folder WHERE CONTAINS('=cmis:name:"*Some*"')
Or you could just use LIKE
SELECT * from cmis:folder WHERE cmis:name LIKE '%Some%'
Name is indexed in three ways
The first two options are used together. You can not split on white space and do a wildcard match on the tokens. You will always get recall from the locale bit (the first way).
It has been suggested before that we support better control here, and it is on the list.
From your example, I think you should be OK with LIKE or =
Andy
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.