Class Aggregations
- java.lang.Object
-
- org.elasticsearch.search.aggregations.Aggregations
-
- All Implemented Interfaces:
Iterable<Aggregation>,ToXContent,ToXContentFragment
- Direct Known Subclasses:
InternalAggregations
public class Aggregations extends Object implements Iterable<Aggregation>, ToXContentFragment
Represents a set ofAggregations
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description protected List<? extends Aggregation>aggregationsstatic StringAGGREGATIONS_FIELD-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description Aggregations(List<? extends Aggregation> aggregations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Aggregation>asList()The list ofAggregations.Map<String,Aggregation>asMap()Returns theAggregations keyed by aggregation name.booleanequals(Object obj)static AggregationsfromXContent(XContentParser parser)<A extends Aggregation>
Aget(String name)Returns the aggregation that is associated with the specified name.Map<String,Aggregation>getAsMap()Returns theAggregations keyed by aggregation name.inthashCode()Iterator<Aggregation>iterator()Iterates over theAggregations.XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)XContentBuildertoXContentInternal(XContentBuilder builder, ToXContent.Params params)Directly write all the aggregations without their bounding object.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
AGGREGATIONS_FIELD
public static final String AGGREGATIONS_FIELD
- See Also:
- Constant Field Values
-
aggregations
protected final List<? extends Aggregation> aggregations
-
-
Constructor Detail
-
Aggregations
public Aggregations(List<? extends Aggregation> aggregations)
-
-
Method Detail
-
iterator
public final Iterator<Aggregation> iterator()
Iterates over theAggregations.- Specified by:
iteratorin interfaceIterable<Aggregation>
-
asList
public final List<Aggregation> asList()
The list ofAggregations.
-
asMap
public final Map<String,Aggregation> asMap()
Returns theAggregations keyed by aggregation name.
-
getAsMap
public final Map<String,Aggregation> getAsMap()
Returns theAggregations keyed by aggregation name.
-
get
public final <A extends Aggregation> A get(String name)
Returns the aggregation that is associated with the specified name.
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
toXContentInternal
public XContentBuilder toXContentInternal(XContentBuilder builder, ToXContent.Params params) throws IOException
Directly write all the aggregations without their bounding object. Used by sub-aggregations (non top level aggs)- Throws:
IOException
-
fromXContent
public static Aggregations fromXContent(XContentParser parser) throws IOException
- Throws:
IOException
-
-