lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mark harwood <markharw...@yahoo.co.uk>
Subject Re: MatchAllDocs in BooleanQuery.rewrite
Date Fri, 02 Feb 2007 09:20:56 GMT
>>are there any legitimate usecases for calling rewrite other then when a Searcher is
about to execute the query?

When using the highlighter it is recommended to use a rewritten query e.g. to get all the
variations for a fuzzy query.
However I don't think there should be a problem with the auto-MatchAllDocs approach you suggest.

Incidentally, the "BooleanFilter" class in contrib/queries adopts the same must/should/mustnot
logic as BooleanQuery (except using Filter clauses rather than Querys) and already includes
the logic you suggest if there are only negative clauses.

Cheers
Mark

----- Original Message ----
From: Chris Hostetter <hossman_lucene@fucit.org>
To: Lucene Dev <java-dev@lucene.apache.org>
Sent: Friday, 2 February, 2007 6:26:46 AM
Subject: MatchAllDocs in BooleanQuery.rewrite


more then once, people have suggested that QueryParser should either throw
and Exception or implicitly put a MatchAllDocsQuery in any BooleanQuery it
produces when the string it's parsing contains entirely negative clauses.

I've argued against this idea because QueryParser doesn't know how the
Query it's producing is oging to be used ... many people (myself included)
use it to parse some user input, which they then combine with other
automaticaly constructed clauses -- and the MatchAllDocsQuery would be a
bad idea.

replying to question about this tonight, it occured to me that
BooleanQuery.rewrite might be a feasible place for code that automaticly
includes a MatchAllDocsQuery when all clauses are negative ... are there
any legitimate usecases for calling rewrite other then when a Searcher is
about to execute the query?


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org






		
___________________________________________________________ 
Inbox full of unwanted email? Get leading protection and 1GB storage with All New Yahoo! Mail.
http://uk.docs.yahoo.com/nowyoucan.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message