lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3207) CustomScoreQuery calls weight() where it should call createWeight()
Date Thu, 16 Jun 2011 07:40:47 GMT


Robert Muir commented on LUCENE-3207:

as an explanation, this causes this query to call sumOfSquaredWeights + queryNorm + normalize()

the reason it doesnt cause any tests to fail in trunk is this:
in trunk sumOfSquaredWeights is not really a getter, its also a setter:
    public float sumOfSquaredWeights() {
      queryWeight = idf * getBoost();             // compute query weight
      return queryWeight * queryWeight;           // square it

in my patch on LUCENE-3174, my sumOfSquaredWeights returns queryWeight * queryWeight, but
doesn't reset any state.
so you end out normalizing twice and thats why the test failed on the branch.

> CustomScoreQuery calls weight() where it should call createWeight()
> -------------------------------------------------------------------
>                 Key: LUCENE-3207
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Robert Muir
>         Attachments: LUCENE-3207.patch
> Thanks to Uwe for helping me track down this bug after I pulled my hair out for hours
on LUCENE-3174.

This message is automatically generated by JIRA.
For more information on JIRA, see:


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

View raw message