>>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 <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






                
___________________________________________________________ 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to