lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: need some advice/help with negative query.
Date Fri, 06 Jan 2006 23:01:46 GMT

: > Should we should detect the case of all negative clauses and throw in
: > a MatchAllDocsQuery?
: >
: > I guess this would be done in the QueryParser, but one could also make
: > a case for doing it in the BooleanQuery.

if it were going to be done, i would add it to the QueryParser, and not to
BooleanQuery ... BooleanQuery serves as a good "container" for other
queries along with their required/optional/prohibited status that can be
passed arround -- if someone is building up a BooleanQuery and
incrimentally adding clauses to it, the only place it could safely assume
it should add a MatchAllDocs query if all of it's clauses are negated is
in the createWeight method -- and that would be a very weird place to do
for the query to modify itself.

Putting logic like this in the QueryParser would seem like it makes the
most sense to me, as long as their was an option to toggle the behavior
on/off for people like me who use QueryParser to generate BooleanQueries
based on one set of input, and then add required/optional clauses to it
based on other sets of input.

I'd even support defaulting the behavior to "on" just because it seems
like it would be more DWIM for casual users (who might not notice an
option for turning it on as easily as experienced users would find an
option for turning it off)


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

View raw message