Class Aggregations

java.lang.Object
org.elasticsearch.search.aggregations.Aggregations
All Implemented Interfaces:
Iterable<Aggregation>, org.elasticsearch.xcontent.ToXContent, org.elasticsearch.xcontent.ToXContentFragment
Direct Known Subclasses:
InternalAggregations

public class Aggregations extends Object implements Iterable<Aggregation>, org.elasticsearch.xcontent.ToXContentFragment
Represents a set of Aggregations
  • Field Details

  • Constructor Details

    • Aggregations

      public Aggregations(List<? extends Aggregation> aggregations)
  • Method Details

    • iterator

      public final Iterator<Aggregation> iterator()
      Iterates over the Aggregations.
      Specified by:
      iterator in interface Iterable<Aggregation>
    • asList

      public final List<Aggregation> asList()
      The list of Aggregations.
    • asMap

      public final Map<String,Aggregation> asMap()
      Returns the Aggregations keyed by aggregation name.
    • getAsMap

      public final Map<String,Aggregation> getAsMap()
      Returns the Aggregations keyed by aggregation name.
    • get

      public final <A extends Aggregation> A get(String name)
      Returns the aggregation that is associated with the specified name.
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toXContent

      public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException
      Specified by:
      toXContent in interface org.elasticsearch.xcontent.ToXContent
      Throws:
      IOException
    • toXContentInternal

      public org.elasticsearch.xcontent.XContentBuilder toXContentInternal(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.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(org.elasticsearch.xcontent.XContentParser parser) throws IOException
      Throws:
      IOException