내 커뮤니티 업적 표시줄을 확대합니다.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Default sorting Criteria for Query Builder results

Avatar

Level 4

Hi All,

 

We have a query like this:

 

path=/content/we-retail

type=cq:Page

fulltext=Men

p.limit=-1

 

Is there any default algorithm for sorting the results when no orderby is specified.

 

From the output results we are not able to find any sort criteria.

 

Any help is appreciated.

 

Thanks

 

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor
Hello @Sb2512 

If you don't provide an orderby the parameter in your AEM Query Builder query, the search results will be sorted by the default ordering, which is usually by the node's jcr:score or _score property, depending on the version of AEM you're using and the indexing configuration.

However, the default sorting order is not always guaranteed and may depend on various factors, such as the search query complexity, the indexing configuration, and the version of AEM you're using. Therefore, it's a good practice to explicitly specify the sorting order in your query using the orderby parameter, to ensure consistent and predictable search results.

The default sorting order for fulltext search in AEM Query Builder is by relevance, as determined by the score

The "jcr:score" property is a built-in property of the Java Content Repository (JCR) specification, which is the underlying technology used by CRX. This property is automatically calculated by CRX during fulltext searches and is used to determine the relevance of the search results.

원본 게시물의 솔루션 보기

3 답변 개

Avatar

Community Advisor

As far as I know, orderby parameter is specified in full-text search query, which means the order in which the search results are returned is not guaranteed to be consistent or predictable.

It may We can see the same results every time because the AEM search engine is returning the results in the same order each time, based on some internal mechanism by this is not reliable. If we need to ensure a specific order of search results, we should always specify an orderby parameter in query.

I never found any article or documentation that says about the default orderby. It could be my limitation.

Avatar

Employee Advisor

hi @Sb2512 ,

 

The index of returned result of the query will differ from instance to instance as it is based on Lucene scores.

 

Also refer post for reference.

Best Regards,

Milind

Avatar

정확한 답변 작성자:
Community Advisor
Hello @Sb2512 

If you don't provide an orderby the parameter in your AEM Query Builder query, the search results will be sorted by the default ordering, which is usually by the node's jcr:score or _score property, depending on the version of AEM you're using and the indexing configuration.

However, the default sorting order is not always guaranteed and may depend on various factors, such as the search query complexity, the indexing configuration, and the version of AEM you're using. Therefore, it's a good practice to explicitly specify the sorting order in your query using the orderby parameter, to ensure consistent and predictable search results.

The default sorting order for fulltext search in AEM Query Builder is by relevance, as determined by the score

The "jcr:score" property is a built-in property of the Java Content Repository (JCR) specification, which is the underlying technology used by CRX. This property is automatically calculated by CRX during fulltext searches and is used to determine the relevance of the search results.