Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

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