[ https://issues.apache.org/jira/browse/LUCENE-1744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731399#action_12731399 ]
Shai Erera commented on LUCENE-1744: ------------------------------------ good catch. I think this was before one of the issues (forgot which) where I added doc as a member to BS2. > 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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org