org.apache.lucene.search.grouping.function

## Class FunctionGrouper

- java.lang.Object
- - org.apache.lucene.search.grouping.Grouper<MutableValue>
  - - org.apache.lucene.search.grouping.function.FunctionGrouper

-     public class FunctionGrouper
      extends Grouper<MutableValue>

  Collector factory for grouping by ValueSource

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FunctionGrouper(ValueSource valueSource, Map<?,?> context)` Create a Grouper for the provided ValueSource and context

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AllGroupsCollector<MutableValue>` | `getAllGroupsCollector()` Create an `AllGroupsCollector`
    `FirstPassGroupingCollector<MutableValue>` | `getFirstPassCollector(Sort sort, int count)` Create a first-pass collector
    `AllGroupHeadsCollector<MutableValue>` | `getGroupHeadsCollector(Sort sort)` Create an `AllGroupHeadsCollector`
    `SecondPassGroupingCollector<MutableValue>` | `getSecondPassCollector(Collection<SearchGroup<MutableValue>> searchGroups, Sort groupSort, Sort withinGroupSort, int maxDocsPerGroup, boolean getScores, boolean getMaxScores, boolean fillSortFields)` Create a second-pass collector

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

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

- - ### Constructor Detail

    - #### FunctionGrouper

          public FunctionGrouper(ValueSource valueSource,
                                 Map<?,?> context)

      Create a Grouper for the provided ValueSource and context

  - ### Method Detail

    - #### getFirstPassCollector

          public FirstPassGroupingCollector<MutableValue> getFirstPassCollector(Sort sort,
                                                                                int count)
                                                                         throws IOException

      Description copied from class: `Grouper`
      Create a first-pass collector
      Specified by:
        `getFirstPassCollector` in class `Grouper<MutableValue>`
      Parameters:
        `sort` - the order in which groups should be returned
        `count` - how many groups to return
      Throws:
        `IOException`

    - #### getGroupHeadsCollector

          public AllGroupHeadsCollector<MutableValue> getGroupHeadsCollector(Sort sort)

      Description copied from class: `Grouper`
      Create an `AllGroupHeadsCollector`
      Specified by:
        `getGroupHeadsCollector` in class `Grouper<MutableValue>`
      Parameters:
        `sort` - a within-group sort order to determine which doc is the group head

    - #### getAllGroupsCollector

          public AllGroupsCollector<MutableValue> getAllGroupsCollector()

      Description copied from class: `Grouper`
      Create an `AllGroupsCollector`
      Specified by:
        `getAllGroupsCollector` in class `Grouper<MutableValue>`

    - #### getSecondPassCollector

          public SecondPassGroupingCollector<MutableValue> getSecondPassCollector(Collection<SearchGroup<MutableValue>> searchGroups,
                                                                                  Sort groupSort,
                                                                                  Sort withinGroupSort,
                                                                                  int maxDocsPerGroup,
                                                                                  boolean getScores,
                                                                                  boolean getMaxScores,
                                                                                  boolean fillSortFields)
                                                                           throws IOException

      Description copied from class: `Grouper`
      Create a second-pass collector
      Specified by:
        `getSecondPassCollector` in class `Grouper<MutableValue>`
      Throws:
        `IOException`

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