Expand my Community achievements bar.

Join us in celebrating the outstanding achievement of our AEM Community Member of the Year!
SOLVED

sorting on the basis of multiple properties in Query builder

Avatar

Level 2

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 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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