AEM Query date range property to query

pn_2007

14-09-2020

I have a query as below:

 

path=/home/project/users
property=customGroup
property.value=Unverified
type=rep:User

 

From this result I need to filter whose

registrationCompletedDate or jcr:createdDate value is greater than 5 days Both these properties are of type Date.

Can you help how I need to modify the query ? Do we have any property to get the dte greater than a particular value?

AEM Query String Parameter querybuilder

Accepted Solutions (1)

Accepted Solutions (1)

Vijayalakshmi_S

MVP

14-09-2020

Hi @pn_2007,

You can make use of predicate named "relativedaterange" to achieve this.

Below is the sample query. (To get all assets that are modified 5 days before)

path=/content/dam/learnings
type=dam:Asset
relativedaterange.property=jcr:content/jcr:lastModified
relativedaterange.lowerBound=-5d  (If no upperBound is specified, it is treated as 0, indicating current time)
p.limit=-1

If any Date property which is in future like say eventDate and to get all events that will happen in next 5 days, then the query will be like

path=/content/dam/learnings
type=dam:Asset
relativedaterange.property=jcr:content/eventDate
relativedaterange.upperBound=5d  (If no lowerBound is specified, it is treated as 0, indicating current time)
p.limit=-1

Other options in detail about this predicate in below link

 

Answers (1)

Answers (1)

Albin_Issac

MVP

14-09-2020

Try something as below

p.limit=-1
p.hits=full
path=/home/project/users
property=customGroup
property.value=Unverified
type=rep:User
group.1_relativedaterange.property=jcr:created
group.1_relativedaterange.upperBound=-5d
group.2_relativedaterange.property=registrationCompletedDate
group.2_relativedaterange.upperBound=-5d
group.p.or=true

Even you can use daterange instead of relativedaterange.

Regards

Albin I

www.albinsblog.com