Class AbstractInternalTerms<A extends AbstractInternalTerms<A,B>,B extends AbstractInternalTerms.AbstractTermsBucket<B>>

All Implemented Interfaces:
NamedWriteable, Writeable, Aggregation, MultiBucketsAggregation, ToXContent, ToXContentFragment
Direct Known Subclasses:
InternalTerms

public abstract class AbstractInternalTerms<A extends AbstractInternalTerms<A,B>,B extends AbstractInternalTerms.AbstractTermsBucket<B>> extends InternalMultiBucketAggregation<A,B>
Base class for terms and multi_terms aggregation that handles common reduce logic
  • Constructor Details

  • Method Details

    • create

      protected abstract A create(String name, List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount)
      Creates InternalTerms at the end of the merge
    • getShardSize

      protected abstract int getShardSize()
    • getReduceOrder

      protected abstract BucketOrder getReduceOrder()
    • getOrder

      protected abstract BucketOrder getOrder()
    • getSumOfOtherDocCounts

      protected abstract long getSumOfOtherDocCounts()
    • getDocCountError

      protected abstract Long getDocCountError()
    • setDocCountError

      protected abstract void setDocCountError(long docCountError)
    • getMinDocCount

      protected abstract long getMinDocCount()
    • getRequiredSize

      protected abstract int getRequiredSize()
    • getShowDocCountError

      protected abstract boolean getShowDocCountError()
    • createBucket

      protected abstract B createBucket(long docCount, InternalAggregations aggs, long docCountError, B prototype)
    • termsAggregationReducer

      public final AggregatorReducer termsAggregationReducer(AggregationReduceContext reduceContext, int size)
    • finalizeSampling

      public InternalAggregation finalizeSampling(SamplingContext samplingContext)
      Description copied from class: InternalAggregation
      Called by the parent sampling context. Should only ever be called once as some aggregations scale their internal values
      Overrides:
      finalizeSampling in class InternalAggregation
      Parameters:
      samplingContext - the current sampling context
      Returns:
      new aggregation with the sampling context applied, could be the same aggregation instance if nothing needs to be done
    • doXContentCommon

      protected static XContentBuilder doXContentCommon(XContentBuilder builder, ToXContent.Params params, boolean showDocCountError, Long docCountError, long otherDocCount, List<? extends AbstractInternalTerms.AbstractTermsBucket<?>> buckets) throws IOException
      Throws:
      IOException