org.apache.solr.search

## Class Grouping.CommandFunc

- java.lang.Object
- - org.apache.solr.search.Grouping.Command<MutableValue>
  - - org.apache.solr.search.Grouping.CommandFunc

- Enclosing class:
    Grouping

      public class Grouping.CommandFunc
      extends Grouping.Command<MutableValue>

  A command for grouping on a function.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ValueSource` | `groupBy`

    - ### Fields inherited from class org.apache.solr.search.Grouping.Command

      `docsPerGroup, format, groupOffset, groupSort, key, main, numGroups, offset, totalCount, withinGroupSort`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommandFunc()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AbstractAllGroupHeadsCollector<?>` | `createAllGroupCollector()` Returns a collector that is able to return the most relevant document of all groups.
    `protected Collector` | `createFirstPassCollector()` Returns one or more `Collector` instances that are needed to perform the first pass search.
    `protected Collector` | `createSecondPassCollector()` Returns zero or more `Collector` instances that are needed to perform the second pass search.
    `protected void` | `finish()` Performs any necessary post actions to prepare the response.
    `int` | `getMatches()` Returns the number of matches for this `Command`.
    `protected Integer` | `getNumberOfGroups()` Returns the number of groups found for this `Command`.
    `protected void` | `prepare()` Prepare this `Command` for execution.

    - ### Methods inherited from class org.apache.solr.search.Grouping.Command

      `addDocList, commonResponse, createSimpleResponse, getDocList`

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

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

- - ### Field Detail

    - #### groupBy

          public ValueSource groupBy

  - ### Constructor Detail

    - #### CommandFunc

          public CommandFunc()

  - ### Method Detail

    - #### prepare

          protected void prepare()
                          throws IOException

      Prepare this `Command` for execution.
      Specified by:
        `prepare` in class `Grouping.Command<MutableValue>`
      Throws:
        `IOException` - If I/O related errors occur

    - #### createFirstPassCollector

          protected Collector createFirstPassCollector()
                                                throws IOException

      Returns one or more `Collector` instances that are needed to perform the first pass search. If multiple Collectors are returned then these wrapped in a `MultiCollector`.
      Specified by:
        `createFirstPassCollector` in class `Grouping.Command<MutableValue>`
      Returns:
        one or more `Collector` instances that are need to perform the first pass search
      Throws:
        `IOException` - If I/O related errors occur

    - #### createSecondPassCollector

          protected Collector createSecondPassCollector()
                                                 throws IOException

      Returns zero or more `Collector` instances that are needed to perform the second pass search. In the case when no `Collector` instances are created `null` is returned. If multiple Collectors are returned then these wrapped in a `MultiCollector`.
      Overrides:
        `createSecondPassCollector` in class `Grouping.Command<MutableValue>`
      Returns:
        zero or more `Collector` instances that are needed to perform the second pass search
      Throws:
        `IOException` - If I/O related errors occur

    - #### createAllGroupCollector

          public AbstractAllGroupHeadsCollector<?> createAllGroupCollector()
                                                                    throws IOException

      Description copied from class: `Grouping.Command`
      Returns a collector that is able to return the most relevant document of all groups. Returns `null` if the command doesn't support this type of collector.
      Overrides:
        `createAllGroupCollector` in class `Grouping.Command<MutableValue>`
      Returns:
        a collector that is able to return the most relevant document of all groups.
      Throws:
        `IOException` - If I/O related errors occur

    - #### finish

          protected void finish()
                         throws IOException

      Performs any necessary post actions to prepare the response.
      Specified by:
        `finish` in class `Grouping.Command<MutableValue>`
      Throws:
        `IOException` - If I/O related errors occur

    - #### getMatches

          public int getMatches()

      Returns the number of matches for this `Command`.
      Specified by:
        `getMatches` in class `Grouping.Command<MutableValue>`
      Returns:
        the number of matches for this `Command`

    - #### getNumberOfGroups

          protected Integer getNumberOfGroups()

      Returns the number of groups found for this `Command`. If the command doesn't support counting the groups `null` is returned.
      Overrides:
        `getNumberOfGroups` in class `Grouping.Command<MutableValue>`
      Returns:
        the number of groups found for this `Command`

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