You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2011/06/16 09:40:47 UTC

[jira] [Commented] (LUCENE-3207) CustomScoreQuery calls weight() where it should call createWeight()

    [ https://issues.apache.org/jira/browse/LUCENE-3207?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13050263#comment-13050263 ] 

Robert Muir commented on LUCENE-3207:
-------------------------------------

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

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:
{noformat}
    @Override
    public float sumOfSquaredWeights() {
      queryWeight = idf * getBoost();             // compute query weight
      return queryWeight * queryWeight;           // square it
    }
{noformat}

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: https://issues.apache.org/jira/browse/LUCENE-3207
>             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: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org