Hello Community - Currently I am using query Builder API to fetch the results from JCR.
One query using sort by on lastModified date and other requirement is to return the "results in random order (I don't mention any orderby here)" when I query JCR, both the options gives me the results in same order. Could you please tell me how to fetch the results by lastModified date.
Below is the query that I am using for OrderBy
Thanks in advance.
Hi @v1101 ,
The Only property that you need to change in your query is the orderby as highlighted below:
The reason fo this is, the query will return the paths till jcr:content and then the query was checking cq:lastModified in jcr:content/jcr:content/cq:lastModified and hence it was not working.
With above change, it should work fine.
Hope this helps!!
You can try something like:
Please check https://helpx.adobe.com/in/experience-manager/6-3/sites/developing/using/querybuilder-api.html for more details. Thanks!!
Try to create your query in below format.
path=/content/we-retail type=cq:Page 1_property=jcr:content/sling:resourceType 1_property.value=weretail/components/structure/page 1_property.operation=like orderby=@jcr:content/cq:lastModified orderby.sort=desc