How to get the search result in such order that the words matched most are in the beginning the list.



If I have a page A tagging with multiple tag values, I want to use the tag values in Page A as search criteria and find out which other pages have one or more than one tag values, I would like the search result returning as the order such, the page should be the first in the list if all tag values are matched, second page in the list should be the one matching (tag values -1), and in this order. Can I use jcr:score for that?

Please help. Thanks.

Accepted Solutions (1)

Accepted Solutions (1)


Community Manager




1. If you are runing a search for page where title contains "xxx" then jcr:score will always be calculated when you use "contains" function in your query and actually jcr:score gives the proximity of those pages matches your condition (that is your specific implementation)

Now another example

2. If you are running a search for pages let say based on modified date then in that case the jcr:score will have some value but that is not supportive to your search as you already searched pages based on modified date and its already sorted but still jcr:score will consist some value while be used not by you but by system when again same search runs.

3.If your search has more than one term and one of the terms is a common term in the repository, then that common word gets less weightage. For e.g. if your content is for the company Polycom, then term like ‘conference might be a common term. So, when you search for ‘VOIP Conference’, then ‘conference’ would get lower weightage.

The Score is calculated using pretty complex mathematical formula. You can read more about it at .Some more explanation is provided at .


For Searching pages with tags :- or


You can implement your use case by custom component by using concept of EDIT DISTANCE ALGO (Link:-

I hope this would help you.


PS:- This is DTM Forum, please post questions on AEM Forum :-


Thanks and Regards

Kautuk Sahni

Answers (0)