org.apache.lucene.search.grouping.term

## Class TermAllGroupHeadsCollector

- java.lang.Object
- - org.apache.lucene.search.SimpleCollector
  - - org.apache.lucene.search.grouping.AllGroupHeadsCollector<BytesRef>
    - - org.apache.lucene.search.grouping.term.TermAllGroupHeadsCollector

- All Implemented Interfaces:
    Collector, LeafCollector

      public abstract class TermAllGroupHeadsCollector
      extends AllGroupHeadsCollector<BytesRef>

  A base implementation of `AllGroupHeadsCollector` for retrieving the most relevant groups when grouping on a string based group field. More specifically this all concrete implementations of this base implementation use `SortedDocValues`.
  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.AllGroupHeadsCollector

      `AllGroupHeadsCollector.GroupHead<T>, AllGroupHeadsCollector.TemporalResult`

  - ### Field Summary

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

      `compIDXEnd, reversed, temporalResult`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TermAllGroupHeadsCollector(String groupField, int numberOfSorts)`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static AllGroupHeadsCollector<BytesRef>` | `create(String groupField, Sort sortWithinGroup)` Creates an `AbstractAllGroupHeadsCollector` instance based on the supplied arguments.
    `static AllGroupHeadsCollector<BytesRef>` | `create(String groupField, Sort sortWithinGroup, int initialSize)` Creates an `AbstractAllGroupHeadsCollector` instance based on the supplied arguments.

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

      `collect, getCollectedGroupHeads, groupHeadsSize, retrieveGroupHeadAndAddIfNotExist, retrieveGroupHeads, retrieveGroupHeads`

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

      `doSetNextReader, getLeafCollector, setScorer`

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

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

    - ### Methods inherited from interface org.apache.lucene.search.Collector

      `needsScores`

- - ### Constructor Detail

    - #### TermAllGroupHeadsCollector

          protected TermAllGroupHeadsCollector(String groupField,
                                               int numberOfSorts)

  - ### Method Detail

    - #### create

          public static AllGroupHeadsCollector<BytesRef> create(String groupField,
                                                                Sort sortWithinGroup)

      Creates an `AbstractAllGroupHeadsCollector` instance based on the supplied arguments. This factory method decides with implementation is best suited. Delegates to `create(String, org.apache.lucene.search.Sort, int)` with an initialSize of 128.
      Parameters:
        `groupField` - The field to group by
        `sortWithinGroup` - The sort within each group
      Returns:
        an `AbstractAllGroupHeadsCollector` instance based on the supplied arguments

    - #### create

          public static AllGroupHeadsCollector<BytesRef> create(String groupField,
                                                                Sort sortWithinGroup,
                                                                int initialSize)

      Creates an `AbstractAllGroupHeadsCollector` instance based on the supplied arguments. This factory method decides with implementation is best suited.
      Parameters:
        `groupField` - The field to group by
        `sortWithinGroup` - The sort within each group
        `initialSize` - The initial allocation size of the internal int set and group list which should roughly match the total number of expected unique groups. Be aware that the heap usage is 4 bytes * initialSize.
      Returns:
        an `AbstractAllGroupHeadsCollector` instance based on the supplied arguments

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