Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Outdated
-
None
-
None
-
None
-
reproducible on latest 11.1 cms version
Description
Dear hippo team,
when working on issue about sorting search results i realized interesting fact.
hippo:paths='some-id-here' and jcr:contains(., 'some-id-here') produce same list of results, but jcr:score by found items will be different. Most likely current implementation of HstQueryImpl can be improved
In our example, text based pdf (asset) with one occurence of search term scores higher with jcr:score function than news document, where search term is used twice. Expected result would be that document with more occurrences of search term gets a higher jcr:score.
In my experiment, HstQueryImpl could be fixed when jcr:contains function is used instead for default scopes (see line 147). This would fix our problem and document with two occurrences would be more important than asset with one. To avoid forking cms code, could you please have a look.
A side note: I am not boosting score of any property and I am simply looking everywhere in my search. See the example of my search:
- gives wrong jcr:score
//*[jcr:contains(., 'kwaliteitssysteem') and (@hippo:paths='channel-documents-root-id' or @hippo:paths='channel-assets-root-id')]
- gives correct jcr:score
//*[jcr:contains(., 'kwaliteitssysteem') and (jcr:contains(@hippo:paths, 'channel-documents-root-id') or jcr:contains(@hippo:paths, 'channel-assets-root-id'))]