Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Results are grouped based on multiple paths used within AEM Query Builder

Avatar

Level 2

When we do query search, results are grouped based on paths. 

For example, if we have queried for paths /content/us/en & /content/ca/en , then results will have group of pages from /us/en and after that it will have group of pages from /ca/en. Even if we try to sort orderby=@jcr:score , sorting is done for 1st set of pages from /us/en and after that it sorts pages from /ca/en, ideally it should be sorting for entire set of result.

 

Sample query:

fulltext=random text

group.1_path=/content/us/en

group.2_path=/content/ca/en

group.p.or=true

orderby=@jcr:score

orderby.sort=desc

 

Result :

0: /content/us/en/page1.html jcr:score = 1.50

1: /content/ca/en/page2.html jcr:score = 2.50

2: /content/ca/en/page3.html jcr:score = 1.20

 

Ideally it should be somewhat like:

0: /content/ca/en/page2.html jcr:score = 2.50

1: /content/us/en/page1.html jcr:score = 1.50

2: /content/ca/en/page3.html jcr:score = 1.20

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
4 Replies

Avatar

Community Advisor

Hi @AkshayWa2 ,

Could you try the following query ? Highlighted part has been changed.

 

fulltext=random text

group.1_path=/content/us/en

group.2_path=/content/ca/en

group.p.or=true

orderby=@jcr:score

orderby.desc=true

 

Thanks,

Somen

 

Avatar

Level 2

Thanks @somen-sarkar for quick response, it sorting but still in group, first group of result is from /us/en since our 1st path in query is /us/en and then second group is considered which is /ca/en which is 2nd path in our query and that is sorted separately

 

0: /content/us/en/page1.html jcr:score = 1.50

1: /content/ca/en/page3.html jcr:score = 1.20

2: /content/ca/en/page2.html jcr:score = 2.50

Avatar

Correct answer by
Community Advisor

Avatar

Administrator

@AkshayWa2 Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni