


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?
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
Sign in to like this content
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
Sign in to like this content
Total Likes