Query Sorting DAM asset and CQ page using Cq last modified or jcr last modifed | Community
Skip to main content
Level 2
July 17, 2018
Solved

Query Sorting DAM asset and CQ page using Cq last modified or jcr last modifed

  • July 17, 2018
  • 1 reply
  • 1331 views

I need a query to search the and display the results of Dam assest and the CQ:pages using the jcr: last modifed or Cq :last modified,

i have observed that few dam assets not having  Cq :last modified, so i have pass the OR condition to check,

and the data will be sorted descending based on Cq :last modified or  jcr: last modifed

group.1.path=/content/inside

group.1.type=cq:Page

group.1.property=@jcr:content/cq:lastModified

group.2.path=/content/dam

group.2.type=dam:Asset

group.2.property=@jcr:content/jcr:lastModified

orderby=@jcr:content/jcr:lastModified

order.sort=desc

group.p.or=true

p.limit=-1

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 arunpatidar

Hi,

I don't think you can sort based on two values and get combined results.

I tried below query which give sort results saparatly based on both , you can try and trying modify according to results

group.p.or=true

group.1_group.path=/content/AEM63App

group.1_group.type=cq:Page

group.2_group.path=/content/dam/AEM63App

group.2_group.type=dam:Asset

1_orderby=@jcr:content/jcr:lastModified

order.sort=desc

2_orderby=@jcr:content/cq:lastModified

order.sort=desc

p.limit=-1

1 reply

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
July 17, 2018

Hi,

I don't think you can sort based on two values and get combined results.

I tried below query which give sort results saparatly based on both , you can try and trying modify according to results

group.p.or=true

group.1_group.path=/content/AEM63App

group.1_group.type=cq:Page

group.2_group.path=/content/dam/AEM63App

group.2_group.type=dam:Asset

1_orderby=@jcr:content/jcr:lastModified

order.sort=desc

2_orderby=@jcr:content/cq:lastModified

order.sort=desc

p.limit=-1

Arun Patidar