You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2009/07/15 13:19:14 UTC

[jira] Resolved: (LUCENE-1744) BooleanScorer2 fails to update this.doc when its the top scorer

     [ https://issues.apache.org/jira/browse/LUCENE-1744?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless resolved LUCENE-1744.
----------------------------------------

    Resolution: Fixed

Thanks Shalin!

> BooleanScorer2 fails to update this.doc when its the top scorer
> ---------------------------------------------------------------
>
>                 Key: LUCENE-1744
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1744
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.9
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>            Priority: Minor
>             Fix For: 2.9
>
>         Attachments: LUCENE-1744.patch
>
>
> When BooleanScorer2 runs the top collection loop (one of its
> score(Collector)) methods, it uses a local "doc" var, ie:
> {code}
> public void score(Collector collector) throws IOException {
>     collector.setScorer(this);
>     int doc;
>     while ((doc = countingSumScorer.nextDoc()) != NO_MORE_DOCS) {
>       collector.collect(doc);
>     }
> }
> {code}
> The problem is, if the child collector calls scorer.doc() it will
> always get -1.  Most Collectors don't actually call scorer.doc(), but
> one important one that does is ScoreCachingWrapperScorer, as it uses
> the doc to know when to invalidate its cache.  Since this always
> returns -1, the ScoreCachingWrapperScorer keeps returning score=0.0 to
> its caller, thus messing up a SortField.SCORE comparator instance if
> it's included in the sort fields.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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