Map<String, String> params = new HashMap<>();
params.put(KEY_PATH, path);
params.put("type", "cq:Page");
params.put("orderby", "jcr:content/@cq:lastModified");
params.put("orderby.sort", "desc");
params.put("1_property", "jcr:content/sling:resourceType");
params.put("1_property.value","cq/experience-fragments/components/xfpage");
params.put("p.offset", "0");
params.put("p.limit", "-1");
params.put("p.guessTotal", "1");
Query query = queryBuilder.createQuery(PredicateGroup.create(params), session);
Here I am getting all the pages of type "cq/experience-fragments/components/xfpage" but I am losing the orderby property. Am I doing wrong something here?
Solved! Go to Solution.
You may need to change orderby with below:
params.put("orderby", "@jcr:content/cq:lastModified");
I ran the same query with above changes and I am able to get results in descending order.
Thanks
Arun
Yes.. you can have
Views
Replies
Total Likes
You may need to change orderby with below:
params.put("orderby", "@jcr:content/cq:lastModified");
I ran the same query with above changes and I am able to get results in descending order.
Thanks
Arun
Thanks Arun. It helped.
params.put("orderby", "@jcr:content/cq:lastModified"); is the correct way.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies