org.apache.lucene.search.grouping.function

## Class FunctionSecondPassGroupingCollector

- java.lang.Object
- - org.apache.lucene.search.Collector
  - - org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector<MutableValue>
    - - org.apache.lucene.search.grouping.function.FunctionSecondPassGroupingCollector

    public class FunctionSecondPassGroupingCollector
    extends AbstractSecondPassGroupingCollector<MutableValue>

Concrete implementation of `AbstractSecondPassGroupingCollector` that groups based on `ValueSource` instances.

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

### Nested Class Summary

### Nested classes/interfaces inherited from class org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector

`AbstractSecondPassGroupingCollector.SearchGroupDocs<GROUP_VALUE_TYPE>`

### Field Summary

### Fields inherited from class org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector

`groupDocs, groupMap`

### Constructor Summary

Constructors
Constructor and Description
`FunctionSecondPassGroupingCollector(Collection<SearchGroup<MutableValue>> searchGroups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields, ValueSource groupByVS, Map<?,?> vsContext)` Constructs a `FunctionSecondPassGroupingCollector` instance.

### Method Summary

Methods
`protected AbstractSecondPassGroupingCollector.SearchGroupDocs<MutableValue>` `retrieveGroup(int doc)` Returns the group the specified doc belongs to or `null` if no group could be retrieved.
`void` `setNextReader(AtomicReaderContext readerContext)`

### Methods inherited from class org.apache.lucene.search.grouping.AbstractSecondPassGroupingCollector

`acceptsDocsOutOfOrder, collect, getTopGroups, setScorer`

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

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

### Constructor Detail

#### FunctionSecondPassGroupingCollector

    public FunctionSecondPassGroupingCollector(Collection<SearchGroup<MutableValue>> searchGroups,
                                       Sort groupSort,
                                       Sort withinGroupSort,
                                       int maxDocsPerGroup,
                                       boolean getScores,
                                       boolean getMaxScores,
                                       boolean fillSortFields,
                                       ValueSource groupByVS,
                                       Map<?,?> vsContext)
                                        throws IOException

Constructs a `FunctionSecondPassGroupingCollector` instance.

Parameters:
  `searchGroups` - The `SearchGroup` instances collected during the first phase.
  `groupSort` - The group sort
  `withinGroupSort` - The sort inside a group
  `maxDocsPerGroup` - The maximum number of documents to collect inside a group
  `getScores` - Whether to include the scores
  `getMaxScores` - Whether to include the maximum score
  `fillSortFields` - Whether to fill the sort values in `TopGroups.withinGroupSort`
  `groupByVS` - The `ValueSource` to group by
  `vsContext` - The value source context
Throws:
  `IOException` - IOException When I/O related errors occur

### Method Detail

#### retrieveGroup

    protected AbstractSecondPassGroupingCollector.SearchGroupDocs<MutableValue> retrieveGroup(int doc)
                                                                                       throws IOException

Description copied from class: `AbstractSecondPassGroupingCollector`
Returns the group the specified doc belongs to or `null` if no group could be retrieved.

Specified by:
  `retrieveGroup` in class `AbstractSecondPassGroupingCollector<MutableValue>`
Parameters:
  `doc` - The specified doc
Returns:
  the group the specified doc belongs to or `null` if no group could be retrieved
Throws:
  `IOException` - If an I/O related error occurred

#### setNextReader

    public void setNextReader(AtomicReaderContext readerContext)
                       throws IOException

Overrides:
  `setNextReader` in class `AbstractSecondPassGroupingCollector<MutableValue>`
Throws:
  `IOException`