javanna commented on code in PR #13542: URL: https://github.com/apache/lucene/pull/13542#discussion_r1750711025
########## lucene/core/src/java/org/apache/lucene/search/IndexSearcher.java: ########## @@ -363,7 +374,88 @@ public static LeafSlice[] slices( LeafSlice[] slices = new LeafSlice[groupedLeaves.size()]; int upto = 0; for (List<LeafReaderContext> currentLeaf : groupedLeaves) { - slices[upto] = new LeafSlice(currentLeaf); + slices[upto] = + new LeafSlice( + new ArrayList<>( + currentLeaf.stream() + .map(LeafReaderContextPartition::createForEntireSegment) + .toList())); + ++upto; + } + + return slices; + } + + /** + * Creates leaf slices that leverage intra-segment concurrency by splitting segments into multiple + * partitions according to the provided max number of documents per slice and maximum number of + * segments per slice. If a segment holds more documents than the provided max per slice, it gets + * split into equal size partitions that each gets its own slice assigned. + * + * <p>Note: this method is not yet called by the default slicing implementation {@link + * #slices(List)}. Certain queries that require segment-level computation ahead of time duplicate Review Comment: Will apply this suggestion. I am removing the explicit mention of KNN queries, because they are a bit of a different world that needs specific treatment, in that the bulk of the work is done as part of query rewrite that parallelizes across segments bypassing the slicing mechanism. -- 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