jpountz commented on a change in pull request #331:
URL: https://github.com/apache/lucene/pull/331#discussion_r719112805



##########
File path: 
lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorable.java
##########
@@ -45,13 +45,41 @@ public static Scorable wrap(Scorable in) {
     if (in instanceof AssertingScorable) {
       return in;
     }
-    return new AssertingScorable(in);
+    // If `in` is Scorer, we need to wrap it as a Scorer instead of Scorable 
because
+    // NumericComparator uses the iterator cost of a Scorer in sort 
optimization.
+    if (in instanceof Scorer) {
+      return new WrappedScorer((Scorer) in);

Review comment:
       Is there a reason not to use AssertingScorer?




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