jpountz commented on code in PR #1039:
URL: https://github.com/apache/lucene/pull/1039#discussion_r929867414


##########
lucene/core/src/test/org/apache/lucene/search/TestWANDScorer.java:
##########
@@ -815,7 +856,7 @@ private void doTestRandomSpecialMaxScore(float maxScore) 
throws IOException {
         }
         builder.add(query, Occur.SHOULD);
       }
-      Query query = builder.build();
+      Query query = numClauses > 0 ? new WANDScorerQuery(builder.build()) : 
builder.build();

Review Comment:
   Maybe we could instead handle it in WandScorerQuery by returning the single 
scorer when there is a single clause?



##########
lucene/core/src/test/org/apache/lucene/search/TestWANDScorer.java:
##########
@@ -947,4 +988,82 @@ public long cost() {
       };
     }
   }
+
+  private static class WANDScorerQuery extends Query {
+    private final BooleanQuery query;
+
+    private WANDScorerQuery(BooleanQuery query) {

Review Comment:
   I wonder if it would make the tests easier to read if we took an array of 
queries here:
   
   ```suggestion
       private WANDScorerQuery(Query... query) {
   ```
   
   while still creating a `BooleanQuery` under the hood to reuse 
equals/hashcode/etc.



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