org.apache.solr.handler.component

## Class StatsField

- java.lang.Object
- - org.apache.solr.handler.component.StatsField

-     public class StatsField
      extends Object

  Models all of the information associated with a single `StatsParams.STATS_FIELD` instance.
  See Also:
    `StatsComponent`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `StatsField.HllOptions` Helper Struct for parsing and encapsulating all of the options relaed to building a `HLL`
    `static class` | `StatsField.Stat` An enumeration representing the sumer set of all possible stat values that can be computed.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Set<StatsField.Stat>` | `DEFAULT_STATS` The set of stats computed by default when no localparams are used to specify explicit stats

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StatsField(ResponseBuilder rb, String statsParam)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `calculateStats(StatsField.Stat stat)`
    `DocSet` | `computeBaseDocSet()` Computes a base `DocSet` for the current request to be used when computing global stats for the local index.
    `StatsValues` | `computeLocalStatsValues(DocSet base)` Computes the `StatsValues` for this `StatsField` relative to the specified `DocSet`
    `StatsField.HllOptions` | `getHllOptions()`
    `boolean` | `getIsShard()`
    `String` | `getOutputKey()` The key to be used when refering to this `StatsField` instance in the response tp clients.
    `List<Double>` | `getPercentilesList()`
    `SchemaField` | `getSchemaField()` The `SchemaField` whose results these stats are computed over, may be null if the stats are computed over the results of a function or query
    `SolrIndexSearcher` | `getSearcher()` The searcher that should be used for processing local stats
    `List<String>` | `getTagList()`
    `double` | `getTdigestCompression()`
    `ValueSource` | `getValueSource()` The `ValueSource` of a function or query whose results these stats are computed over, may be null if the stats are directly over a `SchemaField`
    `boolean` | `includeInResponse(StatsField.Stat stat)`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### DEFAULT_STATS

          public static final Set<StatsField.Stat> DEFAULT_STATS

      The set of stats computed by default when no localparams are used to specify explicit stats

  - ### Constructor Detail

    - #### StatsField

          public StatsField(ResponseBuilder rb,
                            String statsParam)

      Parameters:
        `rb` - the current request/response
        `statsParam` - the raw `StatsParams.STATS_FIELD` string

  - ### Method Detail

    - #### getOutputKey

          public String getOutputKey()

      The key to be used when refering to this `StatsField` instance in the response tp clients.

    - #### computeBaseDocSet

          public DocSet computeBaseDocSet()
                                   throws IOException

      Computes a base `DocSet` for the current request to be used when computing global stats for the local index. This is typically the same as the main DocSet for the `ResponseBuilder` unless `tag`ged filter queries have been excluded using the `ex` local param
      Throws:
        `IOException`

    - #### computeLocalStatsValues

          public StatsValues computeLocalStatsValues(DocSet base)
                                              throws IOException

      Computes the `StatsValues` for this `StatsField` relative to the specified `DocSet`
      Throws:
        `IOException`
      See Also:
        `computeBaseDocSet()`

    - #### getSearcher

          public SolrIndexSearcher getSearcher()

      The searcher that should be used for processing local stats
      See Also:
        `SolrQueryRequest.getSearcher()`

    - #### getSchemaField

          public SchemaField getSchemaField()

      The `SchemaField` whose results these stats are computed over, may be null if the stats are computed over the results of a function or query
      See Also:
        `getValueSource()`

    - #### getValueSource

          public ValueSource getValueSource()

      The `ValueSource` of a function or query whose results these stats are computed over, may be null if the stats are directly over a `SchemaField`
      See Also:
        `getValueSource()`

    - #### getTagList

          public List<String> getTagList()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### calculateStats

          public boolean calculateStats(StatsField.Stat stat)

    - #### includeInResponse

          public boolean includeInResponse(StatsField.Stat stat)

    - #### getPercentilesList

          public List<Double> getPercentilesList()

    - #### getIsShard

          public boolean getIsShard()

    - #### getTdigestCompression

          public double getTdigestCompression()

    - #### getHllOptions

          public StatsField.HllOptions getHllOptions()

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