Class ParsedStats
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.metrics.NumericMetricsAggregation
NumericMetricsAggregation.MultiValue, NumericMetricsAggregation.SingleValue
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected long
protected double
protected double
protected double
Fields inherited from class org.elasticsearch.search.aggregations.ParsedAggregation
metadata
Fields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static void
declareStatsFields(org.elasticsearch.common.xcontent.ObjectParser<? extends ParsedStats,Void> objectParser)
protected org.elasticsearch.common.xcontent.XContentBuilder
doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
static ParsedStats
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser, String name)
double
getAvg()
long
getCount()
double
getMax()
double
getMin()
double
getSum()
getType()
protected org.elasticsearch.common.xcontent.XContentBuilder
otherStatsToXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
double
Return the result of 1 value by nameReturn an iterable over all value names this multi value aggregation provides.Methods inherited from class org.elasticsearch.search.aggregations.ParsedAggregation
declareAggregationFields, getMetadata, getName, parseDouble, setName, toXContent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetadata, getName
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
count
protected long count -
min
protected double min -
max
protected double max -
sum
protected double sum -
avg
protected double avg -
valueAsString
-
-
Constructor Details
-
ParsedStats
public ParsedStats()
-
-
Method Details
-
getCount
public long getCount() -
getMin
public double getMin() -
getMax
public double getMax() -
getAvg
public double getAvg() -
getSum
public double getSum() -
getMinAsString
- Specified by:
getMinAsString
in interfaceStats
- Returns:
- The minimum value of all aggregated values as a String.
-
getMaxAsString
- Specified by:
getMaxAsString
in interfaceStats
- Returns:
- The maximum value of all aggregated values as a String.
-
getAvgAsString
- Specified by:
getAvgAsString
in interfaceStats
- Returns:
- The avg value over all aggregated values as a String.
-
getSumAsString
- Specified by:
getSumAsString
in interfaceStats
- Returns:
- The sum of aggregated values as a String.
-
value
Description copied from interface:NumericMetricsAggregation.MultiValue
Return the result of 1 value by name- Specified by:
value
in interfaceNumericMetricsAggregation.MultiValue
- Parameters:
name
- of the value- Returns:
- the value
-
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 interfaceNumericMetricsAggregation.MultiValue
- Returns:
- iterable over all value names
-
getType
- Specified by:
getType
in interfaceAggregation
- 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 classParsedAggregation
- 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
-