user1050619
user1050619

Reputation: 20866

SOLR date range query for multiple years

I need to implement SOLR date ranges and trying to understand the following 2 conditions from SOLR wiki -

pubdate:[NOW-1YEAR/DAY TO NOW/DAY+1DAY]

createdate:[1976-03-06T23:59:59.999Z/YEAR TO 1976-03-06T23:59:59.999Z]

Im really concerned about the "/" operator within the date ranges.. Can someone explain ?

Upvotes: 0

Views: 601

Answers (1)

BlueM
BlueM

Reputation: 3861

/DAY simply means: use 00:00:00 of that day. Without /DAY, it would be the current time minus 1 year. For the upper boundary, the NOW/DAY+1DAY means: use today, 00:00:00 and add 1 day, which results in tomorrow, 00:00:00.

With /YEAR, it is basically the same: it goes back to January, 1st, 00:00:00 of that year.

You can see this yourself by using debugQuery and taking a look at the timestamps in the querystring.

Upvotes: 1

Related Questions