+1 to Hoss's suggested enhancement to QueryParser.
I'll volunteer to implement this barring any objections in the next
day or so.
Erik
On Jan 6, 2006, at 6:01 PM, Chris Hostetter wrote:
: > 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)
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]