Class Aggregations

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

public class Aggregations
extends java.lang.Object
implements java.lang.Iterable<Aggregation>, org.elasticsearch.common.xcontent.ToXContentFragment
Represents a set of Aggregations
  • Nested Class Summary

    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

    Fields
    Modifier and Type Field Description
    protected java.util.List<? extends Aggregation> aggregations  
    static java.lang.String AGGREGATIONS_FIELD  

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor Description
    Aggregations​(java.util.List<? extends Aggregation> aggregations)  
  • Method Summary

    Modifier and Type Method Description
    java.util.List<Aggregation> asList()
    The list of Aggregations.
    java.util.Map<java.lang.String,​Aggregation> asMap()
    Returns the Aggregations keyed by aggregation name.
    boolean equals​(java.lang.Object obj)  
    static Aggregations fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)  
    <A extends Aggregation>
    A
    get​(java.lang.String name)
    Returns the aggregation that is associated with the specified name.
    java.util.Map<java.lang.String,​Aggregation> getAsMap()
    Returns the Aggregations keyed by aggregation name.
    int hashCode()  
    java.util.Iterator<Aggregation> iterator()
    Iterates over the Aggregations.
    org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)  
    org.elasticsearch.common.xcontent.XContentBuilder toXContentInternal​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.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 Details

    • AGGREGATIONS_FIELD

      public static final java.lang.String AGGREGATIONS_FIELD
      See Also:
      Constant Field Values
    • aggregations

      protected final java.util.List<? extends Aggregation> aggregations
  • Constructor Details

    • Aggregations

      public Aggregations​(java.util.List<? extends Aggregation> aggregations)
  • Method Details

    • iterator

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

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

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

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

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

      public final boolean equals​(java.lang.Object obj)
      Overrides:
      equals in class java.lang.Object
    • hashCode

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

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

      public org.elasticsearch.common.xcontent.XContentBuilder toXContentInternal​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Directly write all the aggregations without their bounding object. Used by sub-aggregations (non top level aggs)
      Throws:
      java.io.IOException
    • fromXContent

      public static Aggregations fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser) throws java.io.IOException
      Throws:
      java.io.IOException