AnsweredAssumed Answered

CMIS SCORE function not working as expected

Question asked by tcuser on Jan 20, 2017
Latest reply on Jan 24, 2017 by tcuser

Hi all,

 

I'm trying to order my CMIS query results by relevance using the score function, but it's not working as it should.

 

For instance, the results of this query:

SELECT D.cmis:name, SCORE() AS relevance FROM cmis:document as D WHERE CONTAINS(D,'test')) ORDER BY relevance DESC

Are not ordered by score:

"example test script.js.sample"                               0.5994702577590942
"2_1995-00001_00001.pdf"                                     0.039295781403779984
"26_1995-00001_00001.pdf"                                   0.12414738535881042
"26_1998-00003_00001.pdf"                                   0.03449612110853195
"Alfresco_Enterprise_4_1_5_Administrator.pdf"     0.11594238877296448

 

Furthermore, if I add the path to the query, like this:

SELECT D.cmis:name, SCORE() AS relevance FROM cmis:document as D WHERE CONTAINS(D,'test')) AND CONTAINS(D, 'PATH:"/app:company_home/st:sites//*"') ORDER BY relevance DESC

The results are not only disordered, but the query is also returning score values greater than 1:

"2_1995-00001_00001.pdf"                                     1.0265105962753296
"26_1995-00001_00001.pdf"                                   1.0837550163269043
"26_1998-00003_00001.pdf"                                   1.0232725143432617
"Alfresco_Enterprise_4_1_5_Administrator.pdf"     1.0782195329666138

 

Is there anything that I'm doing wrong?

 

Thank you in advance!! Regards

Outcomes