msokolov commented on a change in pull request #1233: LUCENE-9202: refactor 
leaf collectors in TopFieldCollector
URL: https://github.com/apache/lucene-solr/pull/1233#discussion_r374948352
 
 

 ##########
 File path: lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java
 ##########
 @@ -555,7 +519,7 @@ public static void populateScores(ScoreDoc[] topDocs, 
IndexSearcher searcher, Qu
 
   final void add(int slot, int doc) {
     bottom = pq.add(new Entry(slot, docBase + doc));
-    queueFull = totalHits == numHits;
+    queueFull = slot == numHits - 1;
 
 Review comment:
   It's because in `PagingFieldCollector` we care about the number of hits 
collected since the first page, rather than `totalHits`, and this abstracts 
away the difference, since `slot` is either `totalHits-1` or `hitsCollected-1`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to