Expand my Community achievements bar.

SOLVED

Search DAM assets and Cq pages using lastModified date | QueryBuilder

Avatar

Level 2

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?
1 Accepted Solution

Avatar

Correct answer by
Level 9

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

View solution in original post

4 Replies

Avatar

Correct answer by
Level 9

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

Avatar

Level 2

Thanks Mshajiahmed,

Its not filtering using this query as well.

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

 

Thanks

Avatar

Level 2

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.