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
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: [email protected]
For additional commands, e-mail: [email protected]