Tuesday, May 3, 2011

Solr fetching date ranges

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

From stackoverflow
  • Hi, 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.

    Lici : Thx David, greetings from Spain
    David Santamaria : You're welcome, If this answer was the solution that you were looking for, just mark as Accepted, If not, let us (the community) know what is still in your way :)

0 comments:

Post a Comment