Thanks Binh! To summarize for everyone else:
1) Queries are parsed left to right 2) NOT sets the Occurs flag of the clause to it’s right to MUST_NOT 3) AND will change the Occurs flag of the clause to it’s left to MUST unless it has already been set to MUST_NOT 4) AND sets the Occurs flag of the clause to it’s right to MUST 5) If the default operator of the query parser has been set to “And”: OR will change the Occurs flag of the clause to it’s left to SHOULD unless it has already been set to MUST_NOT 6) OR sets the Occurs flag of the clause to it’s right to SHOULD Practically speaking this means that NOT takes precedence over AND which takes precedence over OR — but only if the default operator for the query parser has not been changed from the default (“Or”). If the default operator is set to “And” then the behavior is just plain weird. Erich On Monday, May 12, 2014 12:37:24 PM UTC-7, Binh Ly wrote: > > Erich, > > A colleague pointed out to me a much more complete explanation that I > could ever do: > > http://searchhub.org//2011/12/28/why-not-and-or-and-not/ > > But the short of it is, it is working as expected and just need to "map" a > bit back to Lucene Boolean logic to fully understand why/how it works. > -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/447bfb62-4094-4024-9f53-6e713b11b895%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.