org.apache.lucene.search.grouping.term

## Class TermSecondPassGroupingCollector

- java.lang.Object
- - org.apache.lucene.search.SimpleCollector
  - - org.apache.lucene.search.grouping.SecondPassGroupingCollector<BytesRef>
    - - org.apache.lucene.search.grouping.term.TermSecondPassGroupingCollector

- All Implemented Interfaces:
    Collector, LeafCollector

      public class TermSecondPassGroupingCollector
      extends SecondPassGroupingCollector<BytesRef>

  Concrete implementation of `SecondPassGroupingCollector` that groups based on field values and more specifically uses `SortedDocValues` to collect grouped docs.
  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
    `TermSecondPassGroupingCollector(String groupField, Collection<SearchGroup<BytesRef>> groups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doSetNextReader(LeafReaderContext readerContext)`
    `protected SecondPassGroupingCollector.SearchGroupDocs<BytesRef>` | `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

    - #### TermSecondPassGroupingCollector

          public TermSecondPassGroupingCollector(String groupField,
                                                 Collection<SearchGroup<BytesRef>> groups,
                                                 Sort groupSort,
                                                 Sort withinGroupSort,
                                                 int maxDocsPerGroup,
                                                 boolean getScores,
                                                 boolean getMaxScores,
                                                 boolean fillSortFields)
                                          throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### doSetNextReader

          protected void doSetNextReader(LeafReaderContext readerContext)
                                  throws IOException

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

    - #### retrieveGroup

          protected SecondPassGroupingCollector.SearchGroupDocs<BytesRef> 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<BytesRef>`
      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

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