I understand that lucene's AND (&&), OR (||) and NOT (!) operators are
shorthands for REQUIRED, OPTIONAL and EXCLUDE respectively, which is why
one can't treat them as boolean operators (adhering to boolean algebra).

I have been trying to construct a simple OR expression, as follows

q = +(field1:value1 OR field2:value2)

with a match on either field1 or field2. But since the OR is merely an
optional, documents where both field1:value1 and field2:value2 are matched,
the query returns a score resulting in a match on both the clauses.

How do I enforce short-circuiting in this context? In other words, how to
implement short-circuiting as in boolean algebra where an expression A || B
|| C returns true if A is true without even looking into whether B or C
could be true.
-Deepak

Reply via email to