Class FiltersAggregator

All Implemented Interfaces:
, , org.apache.lucene.search.Collector, org.elasticsearch.core.Releasable
Direct Known Subclasses:
FilterByFilterAggregator

public abstract class FiltersAggregator extends BucketsAggregator
  • Field Details

    • FILTERS_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField FILTERS_FIELD
    • OTHER_BUCKET_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField OTHER_BUCKET_FIELD
    • OTHER_BUCKET_KEY_FIELD

      public static final org.elasticsearch.common.xcontent.ParseField OTHER_BUCKET_KEY_FIELD
    • otherBucketKey

      protected final  otherBucketKey
  • Method Details

    • build

      public static  name, AggregatorFactories factories, <QueryToFilterAdapter<?>> filters, boolean keyed,  otherBucketKey, AggregationContext context, Aggregator parent, CardinalityUpperBound cardinality, <,​> metadata) throws
      Build an Aggregator for a filters aggregation. If there isn't a parent, there aren't children, and we don't collect "other" buckets then this will a faster FilterByFilterAggregator aggregator. Otherwise it'll fall back to a slower aggregator that is FiltersAggregator.Compatible with parent, children, and "other" buckets.
      Throws:
    • buildAggregations

      public InternalAggregation[] buildAggregations(long[] owningBucketOrds) throws
      Description copied from class: Aggregator
      Build the results of this aggregation.
      Specified by:
      buildAggregations in class Aggregator
      Parameters:
      owningBucketOrds - the ordinals of the buckets that we want to collect from this aggregation
      Returns:
      the results for each ordinal, in the same order as the array of ordinals
      Throws:
    • buildEmptyAggregation

      public InternalAggregation buildEmptyAggregation()
      Description copied from class: Aggregator
      Build an empty aggregation.
      Specified by:
      buildEmptyAggregation in class Aggregator
    • collectDebugInfo

      public void collectDebugInfo(<,​> add)
      Description copied from class: Aggregator
      Collect debug information to add to the profiling results. This will only be called if the aggregation is being profiled.

      Well behaved implementations will always call the superclass implementation just in case it has something interesting. They will also only add objects which can be serialized with StreamOutput.writeGenericValue(Object) and XContentBuilder.value(Object). And they'll have an integration test.

      Overrides:
      collectDebugInfo in class Aggregator