May 22, 2020
Estimated Post Reading Time ~

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')]


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.