Solr fetching date ranges

Lici picture Lici · Apr 28, 2009 · Viewed 50.9k times · Source

Well, i'm coding some methods for returning solr docs that mach a interval date range. Docs stored date fields with ISO 8601 format.

Any idea?

thx

Answer

David Santamaria picture David Santamaria · Apr 28, 2009

Check in the SOLR wiki for some docs and examples:

timestamp:[* TO NOW]

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

createdate:[1995-12-31T23:59:59.999Z TO 2007-03-06T00:00:00Z]

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

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

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

Hope this helps, David.