On Sun, Feb 8, 2015 at 9:04 PM, Uwe Schindler <u...@thetaphi.de> wrote: > Hi, > > Lucene does not use algebraic / boolean logic! Maybe review this blog > post: https://lucidworks.com/blog/why-not-and-or-and-not/
This article is an old classic. The "plus, minus, nothing" operators aren't without their issues either, though. For example, if you are stuck in an environment where someone else thought it was a great idea to set the "default operator" in the query parser to AND, you might wonder what the syntax is for this third example: fish chips -> MUST match fish, MUST match chips +fish +chips -> MUST match fish, MUST match chips ???? -> SHOULD match fish, SHOULD match chips Yeah, I don't know either. In any case, the issues in the boolean syntax can be avoided: * Always use parentheses when mixing different operators (or possibly use PrecedenceQueryParser. I haven't tried it.) * To any boolean query with only NOT clause, transform it to add a SHOULD clause for MatchAllDocumentsQuery. TX --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org