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

Package org.apache.lucene.search.grouping

# Class TopGroupsCollectorManager<T>

java.lang.Object
org.apache.lucene.search.grouping.TopGroupsCollectorManager<T>

All Implemented Interfaces:
  `CollectorManager<TopGroupsCollector<T>,TopGroups<T>>`

public class TopGroupsCollectorManager<T> extends Object implements CollectorManager<TopGroupsCollector<T>,TopGroups<T>>
A CollectorManager implementation for TopGroupsCollector.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TopGroupsCollectorManager(Supplier<GroupSelector<T>> groupSelectorFactory, Collection<SearchGroup<T>> searchGroups, Sort groupSort, Sort sortWithinGroup, int withinGroupOffset, int maxDocsPerGroup, boolean getMaxScores)`
  Creates a new TopGroupsCollectorManager.
  `TopGroupsCollectorManager(Supplier<GroupSelector<T>> groupSelectorFactory, Collection<SearchGroup<T>> searchGroups, Sort groupSort, Sort sortWithinGroup, int withinGroupOffset, int maxDocsPerGroup, boolean getMaxScores, TopGroups.ScoreMergeMode scoreMergeMode)`
  Creates a new TopGroupsCollectorManager.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TopGroupsCollector<T>`
  `newCollector()`
  `TopGroups<T>`
  `reduce(Collection<TopGroupsCollector<T>> collectors)`

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

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

- ## Constructor Details

  - ### TopGroupsCollectorManager

    public TopGroupsCollectorManager(Supplier<GroupSelector<T>> groupSelectorFactory, Collection<SearchGroup<T>> searchGroups, Sort groupSort, Sort sortWithinGroup, int withinGroupOffset, int maxDocsPerGroup, boolean getMaxScores)
    Creates a new TopGroupsCollectorManager.
    Parameters:
      `groupSelectorFactory` - factory to create group selectors for each collector
      `searchGroups` - the search groups from the first pass
      `groupSort` - the sort to use for groups
      `sortWithinGroup` - the sort to use within each group
      `withinGroupOffset` - the offset within each group to start collecting documents
      `maxDocsPerGroup` - the maximum number of documents per group
      `getMaxScores` - whether to compute max scores

  - ### TopGroupsCollectorManager

    public TopGroupsCollectorManager(Supplier<GroupSelector<T>> groupSelectorFactory, Collection<SearchGroup<T>> searchGroups, Sort groupSort, Sort sortWithinGroup, int withinGroupOffset, int maxDocsPerGroup, boolean getMaxScores, TopGroups.ScoreMergeMode scoreMergeMode)
    Creates a new TopGroupsCollectorManager.
    Parameters:
      `groupSelectorFactory` - factory to create group selectors for each collector
      `searchGroups` - the search groups from the first pass
      `groupSort` - the sort to use for groups
      `sortWithinGroup` - the sort to use within each group
      `withinGroupOffset` - the offset within each group to start collecting documents
      `maxDocsPerGroup` - the maximum number of documents per group
      `getMaxScores` - whether to compute max scores
      `scoreMergeMode` - the mode for merging scores across shards

- ## Method Details

  - ### newCollector

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

  - ### reduce

    public TopGroups<T> reduce(Collection<TopGroupsCollector<T>> collectors) throws IOException
    Specified by:
      `reduce` in interface `CollectorManager<TopGroupsCollector<T>,TopGroups<T>>`
    Throws:
      `IOException`