cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS - CONTAINS does not return all documents

tcuser
Champ on-the-rise
Champ on-the-rise
Hi all,

I'm trying to make case-insensitive queries with and I've found that the CONTAINS method to do so is not working correctly. I've got several documents:

[img]https://cdn-forums.alfresco.com/sites/forums/files/2015-10-29_125526.png[/img]

And the queries are working in some cases but in some others they're not:

SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId WHERE CONTAINS(T,'cm:description:\'*Asdf*\'') – 2 results (OK)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId WHERE CONTAINS(T,'cm:description:\'*asdf*\'') – 2 results (OK)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId WHERE CONTAINS(T,'cm:description:\'*Hola*\'') – 0 results (KO)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId WHERE CONTAINS(T,'cm:description:\'*hola*\'') – 0 results (KO)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId WHERE CONTAINS(T,'cm:description:\'*Sentencia*\'') – 0 results (KO)
SELECT F.cmis:name, T.cm:description FROM cmis:document AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId WHERE CONTAINS(T,'cm:description:\'*sentencia*\'') – 0 results (KO)

Is there anything I'm missing??

Thank you!!
5 REPLIES 5

mrogers
Star Contributor
Star Contributor
Why do you think there is a case sensitivity issue?

tcuser
Champ on-the-rise
Champ on-the-rise
Well in fact it isn't, but the problem came when I tried to make my query case-sensitive with the CONTAINS command, since LOWER or UPPER doesn't work with LIKE… but you're right, maybe I should change this post subject.

mrogers
Star Contributor
Star Contributor
It could be an eventual consistency issue.

But if you are still having problems then I'm wondering if its a cross language search issue?

tcuser
Champ on-the-rise
Champ on-the-rise
I've cleaned my database and started tomcat in English but the problem still presist.

I have this custom folder:

[img]https://cdn-forums.alfresco.com/sites/forums/files/2015-10-29_125526_0.png[/img]

I'm trying to retrieve it, and it's woirking with the LIKE query but not with the CONTAINS one:

SELECT F.cmisSmiley SurprisedbjectId,F.cmis:name,F.cmisSmiley SurprisedbjectTypeId FROM cmis:folder AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId JOIN tc:expediente AS ETC ON F.cmisSmiley SurprisedbjectId=ETC.cmisSmiley SurprisedbjectId JOIN tc:expedienteTC AS Z ON F.cmisSmiley SurprisedbjectId=Z.cmisSmiley SurprisedbjectId WHERE CONTAINS(T,'cm:description:\'*sentencia*\'') AND ETC.tc:ejercicioExpediente = 2000 –> 0 results

SELECT F.cmisSmiley SurprisedbjectId,F.cmis:name,F.cmisSmiley SurprisedbjectTypeId FROM cmis:folder AS F JOIN cm:titled AS T ON F.cmisSmiley SurprisedbjectId=T.cmisSmiley SurprisedbjectId JOIN tc:expediente AS ETC ON F.cmisSmiley SurprisedbjectId=ETC.cmisSmiley SurprisedbjectId JOIN tc:expedienteTC AS Z ON F.cmisSmiley SurprisedbjectId=Z.cmisSmiley SurprisedbjectId WHERE T.cm:description LIKE '%Sentencia%' AND ETC.tc:ejercicioExpediente = 2000 –> 4 results (including this one)

I've tried to restart Alfresco with a FULL index recovery with no luck.

tcuser
Champ on-the-rise
Champ on-the-rise
Help anyone?