Trying to user querybuilder and need to have multiple order by clauses. Tried this, doesn't work (in XPath I can see the order by doesn't get added). What's the correct syntax and where can I find more documentation on using these clauses?
1_orderby=@jcr:content/metadata/docType
1_orderby.sort=asc
2_orderby=@jcr:content/metadata/type
2_orderby.sort=asc
Solved! Go to Solution.
Views
Replies
Total Likes
If using [1] then put at beginning. If using xpath directly then put at last. The correct syntax is last.
Views
Replies
Total Likes
Views
Replies
Total Likes
Try at [1] & will get added in sort. If not added then please engage with official support team.
Views
Replies
Total Likes
Here is the helpful you needed: http://stackoverflow.com/questions/21676718/adobe-cq5-jcr-how-to-orderby-sorting-query-builder-resul...
let me if its not what you need
Views
Replies
Total Likes
Sham,
I figured the issue, but I am not sure I understand how the querybuilder works. So I thought the number 1 before the order by (1_orderby) was for the first order by field. However that number seems global to the query I am executing.
What I mean is this, I had 2 properties I ws searching by
1_property=<property1>
2_property=<property2>
So apparently, the orderby needed 3_ instead of 1_. Kind of does not make sense to me. I thought that number was for the clause not the query.
Is there some documentation that explains what the numbers mean or rather documentation of different queries you can execute and how multiple clauses can be used?
Views
Replies
Total Likes
Sham,
Also need some documentation to understand the significance of @ in queries. For example in here
~~","@jcr:content/metadata/jcr:lastModified
~~","jcr:content/metadata/@jcr:lastModified
when do we put @ before the entire path or at the last? Because both seem to work.
Views
Replies
Total Likes
If using [1] then put at beginning. If using xpath directly then put at last. The correct syntax is last.
Views
Replies
Total Likes
Hi, I am facing same issue.
The search query has two orderby clause but it is not coming in xpath query.
Query:
[
{fulltext=fulltext: fulltext=generation}
{orderby_group=orderby_group: 2_orderby.index=true, 1_orderby=@jcr:score, 2_orderby=@jcr:content/modified_date, 2_orderby.sort=desc, 1_orderby.sort=desc, p.and=true, 1_orderby.index=true}
{path=path: path=/content/test/books}
{1_group=group: or=true[
{1_property=property: property=@jcr:content/offTime, operation=not}
{2_daterange=daterange: property=@jcr:content/offTime, lowerBound=2017-02-16T10:20:36.016Z, lowerOperation=>=}
]}
{2_group=group: [
{1_type=type: type=cq:Page}
]}
]
Warning: no PredicateEvaluator found for 'orderby_group'
xpath query: /jcr:root/content/test/books//element(*, cq:Page)[jcr:contains(., 'generation') and (not(jcr:content/@offTime) or (jcr:content/@offTime >= xs:dateTime('2017-02-16T10:20:36.016Z')))]
Could you please help?
Regards,
Swati
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies