lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Standard Parser Behavior
Date Tue, 10 Apr 2007 04:15:32 GMT
: My first impression is that it is exactly like specifying the terms ...
: however, the boolean expression in me it telling me that's NOT( RADISH OR
: SHOE) ... which, from the programming example I sited before means a

When dealing with Lucene people are strongly encouraged to think in terms
of MUST, MUST_NOT and SHOULD (which are represented in the query parser as
the prefixes "+", "-" and the default) instead of in terms of AND, OR, and
NOT ... Lucene's Boolean Queries (and thus Lucene's QueryParser) is not a
strict Boolean Logic system, so it's best not to try and think of it like

: Put another way, if +(A B) means I must have at least an A or B (or both),
: but +A +B means I have to have both....
: Then why doesn't -(X Y) mean I must not have an X or Y (or not both), where
: -X -Y means I can't have either.

-$FOO means that documents MUST_NOT match the query expressed by $FOO,
if $FOO is (X Y) then documents must not match either X or Y.

+$FOO means that documents MUST match the query expressed by $FOO,
if $FOO is (A B) then documents must match either A or B.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message