Querybuilder multiple orderby not working | Community
Skip to main content
Dterner
Level 2
October 16, 2015
Solved

Querybuilder multiple orderby not working

  • October 16, 2015
  • 3 replies
  • 1970 views

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
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 JustinEd3

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

3 replies

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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

Dterner
DternerAuthor
Level 2
October 16, 2015

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

Adobe Employee
October 16, 2015

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