Search DAM assets and Cq pages using lastModified date | QueryBuilder | Community
Skip to main content
Level 2
October 16, 2015
Solved

Search DAM assets and Cq pages using lastModified date | QueryBuilder

  • October 16, 2015
  • 4 replies
  • 5320 views

Hi,

 
I am querying the cq pages and assets based on the last modified date.
 
Here is the the text that has to be put in query builder debugger:
 
fulltext=geometrix
1_group.p.or=true
 
1_group.1_group.p.and=true
1_group.1_group.path=/content
1_group.1_group.type=cq:Page
1_group.1_group.relativedaterange.property=jcr:content/cq:lastModified
1_group.1_group.relativedaterange.lowerBound=-1M
 
 
1_group.2_group.p.and=true
1_group.2_group.path=/content/dam
1_group.2_group.type=dam:Asset
1_group.2_group.relativedaterange.property=jcr:content/cq:lastModified
1_group.2_group.relativedaterange.lowerBound=-1M
 
It doesn't work.
Here I have to apply lowerbound on both cq:pages and dam assets.
Where am I going wrong?
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 Mshaji

It seems  that Your query has some problem with filtering I get

WARN - NO FILTERING SUPPORT: {1_group=group: and=true[ {path=path: path=/content} {relativedaterange=relativedaterange: lowerBound=-1M, property=jcr:content/cq:lastModified} {type=type: type=cq:Page} ]}
WARN - NO FILTERING SUPPORT: {2_group=group: and=true[ {path=path: path=/content/dam} {relativedaterange=relativedaterange: lowerBound=-1M, property=jcr:content/cq:lastModified} {type=type: type=dam:Asset} ]}

 

Please try this query

fulltext=geometrixx
group.p.or=true
 
group.1_p.and=true
group.1_path=/content
group.1_type=cq:Page
group.1_relativedaterange.property=jcr:content/cq:lastModified
group.1_relativedaterange.lowerBound=-1M
 
 
group.2_p.and=true
group.2_path=/content/dam
group.2_type=dam:Asset
group.2_relativedaterange.property=jcr:content/cq:lastModified

4 replies

MshajiCommunity AdvisorAccepted solution
Community Advisor
October 16, 2015

It seems  that Your query has some problem with filtering I get

WARN - NO FILTERING SUPPORT: {1_group=group: and=true[ {path=path: path=/content} {relativedaterange=relativedaterange: lowerBound=-1M, property=jcr:content/cq:lastModified} {type=type: type=cq:Page} ]}
WARN - NO FILTERING SUPPORT: {2_group=group: and=true[ {path=path: path=/content/dam} {relativedaterange=relativedaterange: lowerBound=-1M, property=jcr:content/cq:lastModified} {type=type: type=dam:Asset} ]}

 

Please try this query

fulltext=geometrixx
group.p.or=true
 
group.1_p.and=true
group.1_path=/content
group.1_type=cq:Page
group.1_relativedaterange.property=jcr:content/cq:lastModified
group.1_relativedaterange.lowerBound=-1M
 
 
group.2_p.and=true
group.2_path=/content/dam
group.2_type=dam:Asset
group.2_relativedaterange.property=jcr:content/cq:lastModified

Level 2
October 16, 2015

Thanks Mshajiahmed,

Its not filtering using this query as well.

Secondly its also returning the jcr:content node as a result.

 

Thanks

Community Advisor
October 16, 2015

Are you sure, I tried the same one. attached screenshot all the query works for me

http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=fulltext%3Dgeometrixx%0D%0Agroup.p.or%3Dtrue%0D%0A+%0D%0Agroup.1_p.and%3Dtrue%0D%0Agroup.1_path%3D%2Fcontent%0D%0Agroup.1_type%3Dcq%3APage%0D%0Agroup.1_relativedaterange.property%3Djcr%3Acontent%2Fcq%3AlastModified%0D%0Agroup.1_relativedaterange.lowerBound%3D-1M%0D%0A+%0D%0A+%0D%0Agroup.2_p.and%3Dtrue%0D%0Agroup.2_path%3D%2Fcontent%2Fdam%0D%0Agroup.2_type%3Ddam%3AAsset%0D%0Agroup.2_relativedaterange.property%3Djcr%3Acontent%2Fcq%3AlastModified

JSON query:

http://localhost:4502/libs/cq/search/content/querydebug.html?_charset_=UTF-8&query=fulltext%3Dgeometrixx%0D%0Agroup.p.or%3Dtrue%0D%0A+%0D%0Agroup.1_p.and%3Dtrue%0D%0Agroup.1_path%3D%2Fcontent%0D%0Agroup.1_type%3Dcq%3APage%0D%0Agroup.1_relativedaterange.property%3Djcr%3Acontent%2Fcq%3AlastModified%0D%0Agroup.1_relativedaterange.lowerBound%3D-1M%0D%0A+%0D%0A+%0D%0Agroup.2_p.and%3Dtrue%0D%0Agroup.2_path%3D%2Fcontent%2Fdam%0D%0Agroup.2_type%3Ddam%3AAsset%0D%0Agroup.2_relativedaterange.property%3Djcr%3Acontent%2Fcq%3AlastModified

Atom Query:

http://localhost:4502/bin/querybuilder.feed?fulltext=geometrixx&group.1_relativedaterange.and=true&group.1_relativedaterange.lowerBound=-1M&group.1_relativedaterange.path=%2fcontent&group.1_relativedaterange.property=jcr%3acontent%2fcq%3alastModified&group.1_relativedaterange.type=cq%3aPage&group.2_type=dam%3aAsset&group.2_type.and=true&group.2_type.path=%2fcontent%2fdam&group.2_type.property=jcr%3acontent%2fcq%3alastModified&group.p.or=true

Level 2
October 16, 2015

Hi Mshajiahmed,

It is returning results but not actually doing the filtering. 

The situation is like this:

I am working on AEM 5.6.1

I have to filter out CQ pages and DAM assets based on lastModified date.

So for that we need to have two daterange properties because for CQ pages it is cq:lastModified and for assets it is jcr:lastModified

I am not able to use daterange in the same query twice. I have tried many ways.

The only way it works in without any groupname:

like

    relativedaterange.property=jcr:content/cq:lastModified

    relativedaterange.lowerBound=-1M

If anyone has done it earlier, it may be a great help.