Expand my Community achievements bar.

SOLVED

Querybuilder multiple orderby not working

Avatar

Level 2

Hi ,

I am trying to implement a component that uses the querybuilder api.

Everything works fine until I try to implement multiple sorting. When I add the second orderby predicate the query simply returns all pages in the project. Not sure what I'm missing.  Appreciate any help:

Here is my query:

path = /content/nera type = cq:Page 1_orderby=@jcr:content/jobtitle 2_orderby=@jcr:content/lname p.hits=full p.nodedepth=1 1_property=jcr:content/cq:template 1_property.value=/apps/nera/templates/expert 2_property=jcr:content/jobtitle 2_property.value=svp
1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Dmitry,

You generally can't reuse the numeric prefixes in the same query. Try replacing 1_orderby and 2_orderby with 3_orderby and 4_orderby.

Justin

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

Hi Dmitry,

You generally can't reuse the numeric prefixes in the same query. Try replacing 1_orderby and 2_orderby with 3_orderby and 4_orderby.

Justin

Avatar

Level 2

That worked, thanks Justin! I looked and didn't see this documented anywhere. Would be super helpful to add to this page:

http://dev.day.com/docs/en/cq/current/dam/customizing_and_extendingcq5dam/query_builder.html

Avatar

Level 2

Hi Dterner, thank you for your feedback. I've logged in the issue so that the information is documented.