Abstract
In Lucene Index, we have a property named boost of type Double which will help assign weightage to desired properties (that are part of fulltext/contains query)
Properties with high boost value will be displayed earlier in the search results.
Recently we had a query in the Community related to this subject to prioritize search term in URL to be first in the search results than the one found in properties like title/description.
In AEM, URL/path to the resource is simply the node names.
Node names are declared as property within the indexRules using special case identifier as :nodename and is already available OOTB in cqPageLucene(/oak:index/cqPageLucene)
Prerequisite for fulltext/contains query : We should make sure that we have two other properties named nodeScopeIndex and analyzed set to true (Both are of type "Boolean")
For Prioritizing : Set boost with higher value for desired property. In this case, it is for nodeName compared to jcr:title/jcr:description
Here is the respective thread in the Community, where I have shared sample fulltext query, index definition and results with screenshots for reference - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/searching-in-specific-order/m-p/421052
Read Full Blog
Q&A
Please use this thread to ask the related questions.
Kautuk Sahni