lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: Query rewriting/optimization
Date Thu, 18 Jun 2009 18:56:33 GMT

: > ((Src:Testing Dst:Test) (Src:Test2 Port:http)).
: > In this case, would Lucene optimize to remove the unwanted BooleanQueries ?

: Alas, Lucene in general does not do such structural optimization (and
: I agree, we should).  EG we could do it during Query.rewrite().

Except that flattening BooleanQueries wouldn't be an optimization -- it 
would be a restructuring that would actually change the scores computed 
(based on the effect of the coord function).

"((A B) (C D))" is a fundementally different query from "(A B C D)" .. the 
client code should controll which gets built.

: There are certain corner cases that are handled, eg a BooleanQuery
: with a single BooleanClause, or BooleanQuery where
: minimumNumberShouldMatch exceeds the number of SHOULD clauses
: immediately returns no matches, etc.

...for the record, these *are* genuiune optimizations, the scores produced 
are the same as if they weren't there.


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

View raw message