gsmiller commented on code in PR #13733: URL: https://github.com/apache/lucene/pull/13733#discussion_r1747170856
########## lucene/facet/src/java/org/apache/lucene/facet/FacetsCollectorManager.java: ########## @@ -54,4 +79,138 @@ public ReducedFacetsCollector(final Collection<FacetsCollector> facetsCollectors facetsCollector -> matchingDocs.addAll(facetsCollector.getMatchingDocs())); } } + + /** Utility method, to search and also collect all hits into the provided {@link Collector}. */ + public static FacetsResult search( + IndexSearcher searcher, Query q, int n, FacetsCollectorManager fcm) throws IOException { Review Comment: Mostly just thinking out loud here, but now that these methods are responsible for creating the `FacetsCollector` that gets returned in the wrapped `FacetsResult` (instead of previously where the user would provide it), it feels a little strange that the user would be responsible for passing in a `FacetsCollectorManager`. Another option would be to have these methods just setup the `FacetsCollectorManager` internally. Is there a need for users to provide their own? I suppose it's useful if users have some use-case where they want to extend FCM with their own customization? And it's also the only way to specify `keepScores`? So maybe we keep this. At the same time, these methods feel aimed at users that want out-of-the-box functionality, so maybe we simplify and take the parameter away? If we did that, I'm not sure how we'd deal with `keepScores` though unless we added yet another parameter to these static methods. -- 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