Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to do a search by date query on cq pages | AEM Community Blog Seeding

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,157 likes

Total Posts

6,247 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,157 likes

Total Posts

6,247 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

26-05-2020

BlogImage.jpg

How to do a search by date query on cq pages by howtoaem Blog

Abstract

How to do a search by date query on cq pages
I am trying to create a blog in cq5. The OOTB search component in blog is not supporting search by date feature. I tried to override it, but could not find the correct query to fetch the blogs created on a particular date. Seems the only functions supported are >,>=,<,<=.

Please help me in finding a query (preferabbly xpath) to fetch a page created on a particular date (cq:lastModified).

Best How To:
There are some functions in XPath like contains or not. There is also one for date fields. Here an example for anything that was just modified in the content tree:

/jcr:root/content//*[@cq:lastModified >= xs:dateTime('2015-05-29T08:44:56.280Z')]

Read Full Blog

How to do a search by date query on cq pages

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager