java.lang.Object
org.elasticsearch.search.aggregations.ParsedAggregation
org.elasticsearch.search.aggregations.metrics.ParsedStats
All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment, Aggregation, NumericMetricsAggregation, NumericMetricsAggregation.MultiValue, Stats
Direct Known Subclasses:
ParsedExtendedStats, ParsedStatsBucket

public class ParsedStats extends ParsedAggregation implements Stats
  • Field Details

    • count

      protected long count
    • min

      protected double min
    • max

      protected double max
    • sum

      protected double sum
    • avg

      protected double avg
    • valueAsString

      protected final Map<String,String> valueAsString
  • Constructor Details

    • ParsedStats

      public ParsedStats()
  • Method Details

    • getCount

      public long getCount()
      Specified by:
      getCount in interface Stats
      Returns:
      The number of values that were aggregated.
    • getMin

      public double getMin()
      Specified by:
      getMin in interface Stats
      Returns:
      The minimum value of all aggregated values.
    • getMax

      public double getMax()
      Specified by:
      getMax in interface Stats
      Returns:
      The maximum value of all aggregated values.
    • getAvg

      public double getAvg()
      Specified by:
      getAvg in interface Stats
      Returns:
      The avg value over all aggregated values.
    • getSum

      public double getSum()
      Specified by:
      getSum in interface Stats
      Returns:
      The sum of aggregated values.
    • getMinAsString

      public String getMinAsString()
      Specified by:
      getMinAsString in interface Stats
      Returns:
      The minimum value of all aggregated values as a String.
    • getMaxAsString

      public String getMaxAsString()
      Specified by:
      getMaxAsString in interface Stats
      Returns:
      The maximum value of all aggregated values as a String.
    • getAvgAsString

      public String getAvgAsString()
      Specified by:
      getAvgAsString in interface Stats
      Returns:
      The avg value over all aggregated values as a String.
    • getSumAsString

      public String getSumAsString()
      Specified by:
      getSumAsString in interface Stats
      Returns:
      The sum of aggregated values as a String.
    • value

      public double value(String name)
      Description copied from interface: NumericMetricsAggregation.MultiValue
      Return the result of 1 value by name
      Specified by:
      value in interface NumericMetricsAggregation.MultiValue
      Parameters:
      name - of the value
      Returns:
      the value
    • valueNames

      public Iterable<String> valueNames()
      Description copied from interface: NumericMetricsAggregation.MultiValue
      Return an iterable over all value names this multi value aggregation provides. The iterable might be created on the fly, if you need to call this multiple times, please cache the result in a variable on caller side..
      Specified by:
      valueNames in interface NumericMetricsAggregation.MultiValue
      Returns:
      iterable over all value names
    • getType

      public String getType()
      Specified by:
      getType in interface Aggregation
      Returns:
      a string representing the type of the aggregation. This type is added to the aggregation name in the response, so that it can later be used by clients to determine type of the aggregation and parse it into the proper object.
    • doXContentBody

      protected org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      doXContentBody in class ParsedAggregation
      Throws:
      IOException
    • declareStatsFields

      protected static void declareStatsFields(org.elasticsearch.common.xcontent.ObjectParser<? extends ParsedStats,Void> objectParser)
    • fromXContent

      public static ParsedStats fromXContent(org.elasticsearch.common.xcontent.XContentParser parser, String name)
    • otherStatsToXContent

      protected org.elasticsearch.common.xcontent.XContentBuilder otherStatsToXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException
      Throws:
      IOException