lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: BooleanWeight.normalize(float) doesn't normalize prohibited clauses?
Date Thu, 11 May 2006 06:56:33 GMT
On Thursday 11 May 2006 01:39, Chris Hostetter wrote:
> 
> I'm looking into some of the issues with LUCENE-557 and it seems that a
> lot of them are triggered by the way BooleanWeight.normalize is
> implimented...
> 
>     public void normalize(float norm) {
>       norm *= getBoost();                         // incorporate boost
>       for (int i = 0 ; i < weights.size(); i++) {
>         BooleanClause c = (BooleanClause)clauses.elementAt(i);
>         Weight w = (Weight)weights.elementAt(i);
>         if (!c.isProhibited())
>           w.normalize(norm);
>       }
>     }
> 
> ...since prohibited clauses aren't normalized, they sub-weights don't get
> their weights set properly, which means that when the Explanation is
> claculated, they tend to result in an Explanation with a value of "0" ...
> and since they are prohibited, the Explanation for BooleanQuery thinks
> that is a good thing.
> 
> Does anyone know why normalize ignores the prohibited clauses?  was that
> just intended to be an optimization (save time calculating stuff for
> clauses we don't care about scoring in depth) ... ?

A prohibited clause will never occur in any matching document, so it
will never need to take part in any score value calculation.

Regards,
Paul Elschot

---------------------------------------------------------------------
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