DistinctValuesCollectorManager (Lucene 10.5.0 grouping API)
Description: declaration: package: org.apache.lucene.search.grouping, class: DistinctValuesCollectorManager

Package org.apache.lucene.search.grouping

# Class DistinctValuesCollectorManager<T,R>

java.lang.Object
org.apache.lucene.search.grouping.DistinctValuesCollectorManager<T,R>

All Implemented Interfaces:
  `CollectorManager<DistinctValuesCollector<T,R>,List<DistinctValuesCollector.GroupCount<T,R>>>`

public class DistinctValuesCollectorManager<T,R> extends Object implements CollectorManager<DistinctValuesCollector<T,R>,List<DistinctValuesCollector.GroupCount<T,R>>>
A `CollectorManager` implementation for `DistinctValuesCollector` that supports parallel collection and merges results by taking the union of distinct values per group across segments.

WARNING: This API is experimental and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DistinctValuesCollectorManager(Supplier<GroupSelector<T>> groupSelectorFactory, Collection<SearchGroup<T>> searchGroups, Supplier<GroupSelector<R>> valueSelectorFactory)`
  Creates a new DistinctValuesCollectorManager.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DistinctValuesCollector<T,R>`
  `newCollector()`
  `List<DistinctValuesCollector.GroupCount<T,R>>`
  `reduce(Collection<DistinctValuesCollector<T,R>> collectors)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DistinctValuesCollectorManager

    public DistinctValuesCollectorManager(Supplier<GroupSelector<T>> groupSelectorFactory, Collection<SearchGroup<T>> searchGroups, Supplier<GroupSelector<R>> valueSelectorFactory)
    Creates a new DistinctValuesCollectorManager.
    Parameters:
      `groupSelectorFactory` - factory to create group selectors for each collector
      `searchGroups` - the search groups from the first pass
      `valueSelectorFactory` - factory to create value selectors for each collector

- ## Method Details

  - ### newCollector

    public DistinctValuesCollector<T,R> newCollector() throws IOException
    Specified by:
      `newCollector` in interface `CollectorManager<T,R>`
    Throws:
      `IOException`

  - ### reduce

    public List<DistinctValuesCollector.GroupCount<T,R>> reduce(Collection<DistinctValuesCollector<T,R>> collectors)
    Specified by:
      `reduce` in interface `CollectorManager<T,R>`