Class AbstractAggregationBuilder<AB extends AbstractAggregationBuilder<AB>>

java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
All Implemented Interfaces:
NamedWriteable, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment, Rewriteable<AggregationBuilder>, BaseAggregationBuilder
Direct Known Subclasses:
AdjacencyMatrixAggregationBuilder, CompositeAggregationBuilder, FilterAggregationBuilder, FiltersAggregationBuilder, GlobalAggregationBuilder, MultiValuesSourceAggregationBuilder, NestedAggregationBuilder, ReverseNestedAggregationBuilder, SamplerAggregationBuilder, ScriptedMetricAggregationBuilder, SignificantTextAggregationBuilder, TopHitsAggregationBuilder, ValuesSourceAggregationBuilder

public abstract class AbstractAggregationBuilder<AB extends AbstractAggregationBuilder<AB>>
extends AggregationBuilder
Base implementation of a AggregationBuilder.
  • Field Details

    • metadata

      protected java.util.Map<java.lang.String,​java.lang.Object> metadata
  • Constructor Details

    • AbstractAggregationBuilder

      public AbstractAggregationBuilder​(java.lang.String name)
      Constructs a new aggregation builder.
      Parameters:
      name - The aggregation name
    • AbstractAggregationBuilder

      protected AbstractAggregationBuilder​(AbstractAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,​java.lang.Object> metadata)
    • AbstractAggregationBuilder

      protected AbstractAggregationBuilder​(StreamInput in) throws java.io.IOException
      Read from a stream.
      Throws:
      java.io.IOException
  • Method Details

    • writeTo

      public final void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Throws:
      java.io.IOException
    • doWriteTo

      protected abstract void doWriteTo​(StreamOutput out) throws java.io.IOException
      Throws:
      java.io.IOException
    • subAggregation

      public AB subAggregation​(AggregationBuilder aggregation)
      Description copied from class: AggregationBuilder
      Add a sub aggregation to this builder.
      Specified by:
      subAggregation in class AggregationBuilder
    • subAggregation

      public AB subAggregation​(PipelineAggregationBuilder aggregation)
      Add a sub aggregation to this aggregation.
      Specified by:
      subAggregation in class AggregationBuilder
    • subAggregations

      public AB subAggregations​(AggregatorFactories.Builder subFactories)
      Registers sub-factories with this factory. The sub-factory will be responsible for the creation of sub-aggregators under the aggregator created by this factory.
      Specified by:
      subAggregations in interface BaseAggregationBuilder
      Specified by:
      subAggregations in class AggregationBuilder
      Parameters:
      subFactories - The sub-factories
      Returns:
      this factory (fluent interface)
    • setMetadata

      public AB setMetadata​(java.util.Map<java.lang.String,​java.lang.Object> metadata)
      Description copied from class: AggregationBuilder
      Associate metadata with this AggregationBuilder.
      Specified by:
      setMetadata in interface BaseAggregationBuilder
      Specified by:
      setMetadata in class AggregationBuilder
    • getMetadata

      public java.util.Map<java.lang.String,​java.lang.Object> getMetadata()
      Description copied from class: AggregationBuilder
      Return any associated metadata with this AggregationBuilder.
      Specified by:
      getMetadata in class AggregationBuilder
    • getWriteableName

      public final java.lang.String getWriteableName()
      Description copied from interface: NamedWriteable
      Returns the name of the writeable object
    • build

      public final AggregatorFactory build​(AggregationContext context, AggregatorFactory parent) throws java.io.IOException
      Description copied from class: AggregationBuilder
      Internal: build an AggregatorFactory based on the configuration of this builder.
      Specified by:
      build in class AggregationBuilder
      Throws:
      java.io.IOException
    • doBuild

      protected abstract AggregatorFactory doBuild​(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder) throws java.io.IOException
      Throws:
      java.io.IOException
    • toXContent

      public final org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Throws:
      java.io.IOException
    • internalXContent

      protected abstract org.elasticsearch.common.xcontent.XContentBuilder internalXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Throws:
      java.io.IOException
    • hashCode

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

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