javanna commented on code in PR #13542:
URL: https://github.com/apache/lucene/pull/13542#discussion_r1686447283


##########
lucene/core/src/test/org/apache/lucene/search/TestSynonymQuery.java:
##########
@@ -198,7 +198,17 @@ private void doTestScores(int totalHitsThreshold) throws 
IOException {
     if (topDocs.totalHits.value < totalHitsThreshold) {
       assertEquals(new TotalHits(11, TotalHits.Relation.EQUAL_TO), 
topDocs.totalHits);
     } else {
-      assertEquals(TotalHits.Relation.GREATER_THAN_OR_EQUAL_TO, 
topDocs.totalHits.relation);
+      /*
+      TODO: this is probably not the correct long term fix, yet it targets an 
edge case that I am not even sure we
+       should worry about. The problem already exists without intra-segment 
concurrency.
+      When a slice targets a single document, it does not early terminate, as 
the totalHitsThreshold check is
+      performed after collecting each doc. We will then get accurate results.
+       */
+      if (hasSingleDocSlice(searcher)) {

Review Comment:
   This is caused by sometimes using a very low `maxDocsPerSlice` in 
`LuceneTestCase` (`1`):  I am tempted to remove the TODO, perhaps this is an ok 
fix for the test, unless we want to have more control over the index searcher 
randomizations and not leverage the scenarios that requires this fix. Is this 
something that we would rather want to fix in prod code? @jpountz you may have 
an opinion.



-- 
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.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to