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


##########
lucene/test-framework/src/java/org/apache/lucene/tests/search/ScorerIndexSearcher.java:
##########
@@ -76,4 +77,14 @@ protected void search(List<LeafReaderContext> leaves, Weight 
weight, Collector c
       }
     }
   }
+
+  @Override
+  protected void search(LeafReaderContextPartition[] leaves, Weight weight, 
Collector collector)
+      throws IOException {
+    // TODO we should probably update this
+    search(
+        Arrays.stream(leaves).map(leafReaderContextSlice -> 
leafReaderContextSlice.ctx).toList(),
+        weight,
+        collector);

Review Comment:
   Question about this: this is used in a single test 
(`TestBooleanQueryVisitSubscorers`), which never sets the executor, hence 
there's always ever going to be a single slice and no parallelism. It is 
meaningless to do anything better than what I did here, but 
`ScorerIndexSearcher` is public and part of the lucene test framework, so even 
if we never use the `ScorerIndexSearcher(IndexReader, Executor)` constructor 
internally, there may be external users? 
   
   I want to double check that this is worth iterating further on, to support 
concurrent executor across leaf partitions.



##########
lucene/test-framework/src/java/org/apache/lucene/tests/search/ScorerIndexSearcher.java:
##########
@@ -76,4 +77,14 @@ protected void search(List<LeafReaderContext> leaves, Weight 
weight, Collector c
       }
     }
   }
+
+  @Override
+  protected void search(LeafReaderContextPartition[] leaves, Weight weight, 
Collector collector)
+      throws IOException {
+    // TODO we should probably update this
+    search(
+        Arrays.stream(leaves).map(leafReaderContextSlice -> 
leafReaderContextSlice.ctx).toList(),
+        weight,
+        collector);

Review Comment:
   Question about this: this is used in a single test 
(`TestBooleanQueryVisitSubscorers`), which never sets the executor, hence 
there's always ever going to be a single slice and no parallelism. It is 
meaningless to do anything better than what I did here, but 
`ScorerIndexSearcher` is public and part of the lucene test framework, so even 
if we never use the `ScorerIndexSearcher(IndexReader, Executor)` constructor 
internally, there may be external users? 
   
   I want to double check that this is worth iterating further on, to support 
concurrent search across leaf partitions.



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