gsmiller commented on code in PR #13735: URL: https://github.com/apache/lucene/pull/13735#discussion_r1750884436
########## lucene/core/src/java/org/apache/lucene/search/CollectorManager.java: ########## @@ -46,4 +48,28 @@ public interface CollectorManager<C extends Collector, T> { * called after collection is finished on all provided collectors. */ T reduce(Collection<C> collectors) throws IOException; + + /** + * Wrap a provided {@link Collector} with a thin {@code CollectorManager} wrapper for use with + * {@link IndexSearcher#search(Query, CollectorManager)}. The wrapping {@code CollectorManager} + * provides no {@link CollectorManager#reduce(Collection)} implementation, so the wrapped {@code + * Collector} needs to do all relevant work while collecting. + * + * <p>Note: This is only safe to use when {@code IndexSearcher} is created with no executor (see: + * {@link IndexSearcher#IndexSearcher(IndexReader, Executor)}), or the provided collector is + * threadsafe. + */ + static <C extends Collector> CollectorManager<C, ?> wrap(C in) { Review Comment: Makes sense. I'll revise the name (but if you have suggestions, I'm open to them; naming can be tricky) -- 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