sorting on the basis of multiple properties in Query builder | Community
Skip to main content
Level 2
October 7, 2024
Solved

sorting on the basis of multiple properties in Query builder

  • October 7, 2024
  • 1 reply
  • 503 views

i want to write query where i need to find pages, and result should be sorted the basic of two properties, 1. rank , 2. cq:lastModified 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by TarunKumar

Hi @mohit3 ,

 

If you want to sort your result based on multiple property then you can try to implement below:

map.put("1_orderby", "@jcr:content/rank"); map.put("orderby.sort", "desc"); // in case you want it descending map.put("2_orderby", ""@jcr:content/jcr:lastModified""); map.put("orderby.sort", "asc"); // in case you want it ascending

 

You can try to change the sequence based on priority.

 

 

-Tarun

1 reply

TarunKumar
Community Advisor
TarunKumarCommunity AdvisorAccepted solution
Community Advisor
October 7, 2024

Hi @mohit3 ,

 

If you want to sort your result based on multiple property then you can try to implement below:

map.put("1_orderby", "@jcr:content/rank"); map.put("orderby.sort", "desc"); // in case you want it descending map.put("2_orderby", ""@jcr:content/jcr:lastModified""); map.put("orderby.sort", "asc"); // in case you want it ascending

 

You can try to change the sequence based on priority.

 

 

-Tarun