Generates a date range query to send to Solr.