org.apache.lucene.search.grouping.function

## Class FunctionSecondPassGroupingCollector

- java.lang.Object
- - org.apache.lucene.search.SimpleCollector
  - - org.apache.lucene.search.grouping.SecondPassGroupingCollector<MutableValue>
    - - org.apache.lucene.search.grouping.function.FunctionSecondPassGroupingCollector

- All Implemented Interfaces:
    Collector, LeafCollector

      public class FunctionSecondPassGroupingCollector
      extends SecondPassGroupingCollector<MutableValue>

  Concrete implementation of `SecondPassGroupingCollector` 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.SecondPassGroupingCollector

      `SecondPassGroupingCollector.SearchGroupDocs<T>`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.search.grouping.SecondPassGroupingCollector

      `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

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doSetNextReader(LeafReaderContext readerContext)`
    `protected SecondPassGroupingCollector.SearchGroupDocs<MutableValue>` | `retrieveGroup(int doc)` Returns the group the specified doc belongs to or `null` if no group could be retrieved.

    - ### Methods inherited from class org.apache.lucene.search.grouping.SecondPassGroupingCollector

      `collect, getTopGroups, needsScores, setScorer`

    - ### Methods inherited from class org.apache.lucene.search.SimpleCollector

      `getLeafCollector`

    - ### 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 SecondPassGroupingCollector.SearchGroupDocs<MutableValue> retrieveGroup(int doc)
                                                                                     throws IOException

      Description copied from class: `SecondPassGroupingCollector`
      Returns the group the specified doc belongs to or `null` if no group could be retrieved.
      Specified by:
        `retrieveGroup` in class `SecondPassGroupingCollector<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

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext readerContext)
                                  throws IOException

      Overrides:
        `doSetNextReader` in class `SecondPassGroupingCollector<MutableValue>`
      Throws:
        `IOException`

Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.