lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject BooleanWeight.normalize(float) doesn't normalize prohibited clauses?
Date Wed, 10 May 2006 23:39:36 GMT

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

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

...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) ... ?


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

View raw message