gaobinlong commented on code in PR #16247:
URL: https://github.com/apache/lucene/pull/16247#discussion_r3426723388
##########
lucene/grouping/src/java/org/apache/lucene/search/grouping/GroupingSearch.java:
##########
@@ -69,17 +73,29 @@ public class GroupingSearch {
* @param groupField The name of the field to group by.
*/
public GroupingSearch(String groupField) {
- this(new TermGroupSelector(groupField), null);
+ this(() -> new TermGroupSelector(groupField), null);
+ }
+
+ /**
+ * Constructs a <code>GroupingSearch</code> instance that groups documents
using a {@link
+ * GroupSelector} factory.
+ *
+ * @param grouperFactory a factory that creates fresh {@link GroupSelector}
instances
+ */
+ public GroupingSearch(Supplier<GroupSelector<?>> grouperFactory) {
+ this(grouperFactory, null);
}
/**
* Constructs a <code>GroupingSearch</code> instance that groups documents
using a {@link
* GroupSelector}
*
* @param groupSelector a {@link GroupSelector} that defines groups for this
GroupingSearch
+ * @deprecated Use {@link #GroupingSearch(Supplier)} to provide a factory
for concurrent search
*/
+ @Deprecated
public GroupingSearch(GroupSelector<?> groupSelector) {
- this(groupSelector, null);
+ this(() -> groupSelector, null);
Review Comment:
Removed it and and updated the callers.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]