I have a Solr document schema with with a solr.TrieDateField
and noticed this boolean query (not authored by me) which I thought could benefit from some simplification;
q=-(-event_date:[2011-12-02T00:00:00.000Z TO NOW/DAY+90DAYS] OR (event_date:[* TO *]))
which means events within the next 90 days or non-events (See Pure Negative for Solr boolean NOT
notation) . My simplification looked like
q=event_date:[2011-12-02T00:00:00.000Z TO NOW/DAY+90DAYS] OR -event_date:[* TO *]
As stated, this didn't work (0 results). So as a test I ran the two sides of my modified OR query individually and the sum of the two results (both non-zero) equaled the sum of the original query and I can't come up with a good explanation why. Running with debugQuery=true
didn't present anything helpful.
I've put this on solr-user, will post back with any solutions.