Fetch pages based on date | Community
Skip to main content
Jai1122
Level 4
October 16, 2015
Solved

Fetch pages based on date

I am trying to build a search component which involves search using date also. 

Developed a query like this with help from this forum

path=/content/blog
type=cq:Page
group.p.or=true
group.1_fulltext=fullTextSearchTerm
group.1_fulltext.relPath=jcr:content/@cq:tags
group.2_fulltext=2015-05-21
group.2_fulltext.relPath=jcr:content
group.3_fulltext=2015-05-21
group.3_fulltext.relPath=jcr:content/@cq:lastModified
orderby=@jcr:content/cq:lastModified
orderby.sort=desc

Date feature is not working. Will the query be different for Date ? I am new to this topic. Request your help.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

 You are showing Query Builder API. See here for more information about how to use this in a tool and more syntax examples. 

http://cq-ops.tumblr.com/post/23543240500/how-to-use-cqs-query-debugger-tool

You can also use JCR SQL to query dates.

Here is more information on using JCR SQL to query dates:

http://stackoverflow.com/questions/15117075/jcr-sql2-query-comparing-dates

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

 You are showing Query Builder API. See here for more information about how to use this in a tool and more syntax examples. 

http://cq-ops.tumblr.com/post/23543240500/how-to-use-cqs-query-debugger-tool

You can also use JCR SQL to query dates.

Here is more information on using JCR SQL to query dates:

http://stackoverflow.com/questions/15117075/jcr-sql2-query-comparing-dates

Translate