lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
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
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) ... ?



-Hoss


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