I've put the question nicely formatted on StackOverflow here
http://stackoverflow.com/questions/8360257/solr-lucene-why-is-this-or-query-failing-when-the-two-individual-queries-suc

Here is that question Verbatim:

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<http://wiki.apache.org/solr/SolrQuerySyntax#Differences_From_Lucene_Query_Parser>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 the 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.
Thanks,

Mark

Reply via email to