How to filter query in solr by date?

If you want to get last week publications you can do somehting like:

&fq=published_date:[NOW-7DAY/DAY TO NOW]

But if you want a concrete date you must do it in the SOLR date format:

&fq=published_date:[2013-07-17T00:00:00Z TO NOW]

Last but not least.

  • use [ ] for inclusive ranges
  • use { } for exclusive ranges
  • you can mix them like [ } for inclusive – exclusive and vice versa { ]

I hope that helps

Leave a Comment