Class FiltersAggregator
java.lang.Object
org.elasticsearch.search.aggregations.BucketCollector
org.elasticsearch.search.aggregations.Aggregator
org.elasticsearch.search.aggregations.AggregatorBase
org.elasticsearch.search.aggregations.bucket.BucketsAggregator
org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.search.Collector,org.elasticsearch.core.Releasable
- Direct Known Subclasses:
FilterByFilterAggregator
Aggregator for
filters. There are two known subclasses,
FilterByFilterAggregator which is fast but only works in some cases and
FiltersAggregator.Compatible which works in all cases.
build(java.lang.String, org.elasticsearch.search.aggregations.AggregatorFactories, java.util.List<org.elasticsearch.search.aggregations.bucket.filter.QueryToFilterAdapter<?>>, boolean, java.lang.String, org.elasticsearch.search.aggregations.support.AggregationContext, org.elasticsearch.search.aggregations.Aggregator, org.elasticsearch.search.aggregations.CardinalityUpperBound, java.util.Map<java.lang.String, java.lang.Object>) will build the fastest version that
works with the configuration.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
BucketsAggregator.BucketBuilderForFixedCount<B>, BucketsAggregator.BucketBuilderForVariable<B>, BucketsAggregator.ResultBuilderForVariable<B>, BucketsAggregator.SingleBucketResultBuilderNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.Aggregator
Aggregator.BucketComparator, Aggregator.Parser, Aggregator.SubAggCollectionMode -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ParseFieldstatic org.elasticsearch.common.xcontent.ParseFieldstatic org.elasticsearch.common.xcontent.ParseFieldprotected StringFields inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
docCountProviderFields inherited from class org.elasticsearch.search.aggregations.AggregatorBase
collectableSubAggregators, DEFAULT_WEIGHT, name, parent, subAggregatorsFields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR -
Method Summary
Modifier and TypeMethodDescriptionstatic FiltersAggregatorbuild(String name, AggregatorFactories factories, List<QueryToFilterAdapter<?>> filters, boolean keyed, String otherBucketKey, AggregationContext context, Aggregator parent, CardinalityUpperBound cardinality, Map<String,Object> metadata)Build anAggregatorfor afiltersaggregation.buildAggregations(long[] owningBucketOrds)Build the results of this aggregation.Build an empty aggregation.voidCollect debug information to add to the profiling results.Methods inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
bucketComparator, bucketDocCount, buildAggregationsForFixedBucketCount, buildAggregationsForSingleBucket, buildAggregationsForVariableBuckets, buildSubAggsForAllBuckets, buildSubAggsForBuckets, buildSubAggsForBuckets, close, collectBucket, collectExistingBucket, descendsFromGlobalAggregator, getDocCounts, grow, incrementBucketDocCount, maxBucketOrd, preGetSubLeafCollectors, prepareSubAggs, resolveSortPath, rewriteBucketsMethods inherited from class org.elasticsearch.search.aggregations.AggregatorBase
addRequestCircuitBreakerBytes, bigArrays, buildEmptySubAggregations, doClose, doPostCollection, doPreCollection, getLeafCollector, getLeafCollector, metadata, name, parent, pointReaderIfAvailable, postCollection, preCollection, scoreMode, searcher, subAggregator, subAggregators, topLevelQuery, toStringMethods inherited from class org.elasticsearch.search.aggregations.Aggregator
buildTopLevel, resolveSortPathOnValidAgg
-
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
-
-
Method Details
-
build
public static FiltersAggregator build(String name, AggregatorFactories factories, List<QueryToFilterAdapter<?>> filters, boolean keyed, String otherBucketKey, AggregationContext context, Aggregator parent, CardinalityUpperBound cardinality, Map<String,Object> metadata) throws IOExceptionBuild anAggregatorfor afiltersaggregation. If there isn't a parent, there aren't children, and we don't collect "other" buckets then this will a fasterFilterByFilterAggregatoraggregator. Otherwise it'll fall back to a slower aggregator that isFiltersAggregator.Compatiblewith parent, children, and "other" buckets.- Throws:
IOException
-
buildAggregations
Description copied from class:AggregatorBuild the results of this aggregation.- Specified by:
buildAggregationsin classAggregator- 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:
IOException
-
buildEmptyAggregation
Description copied from class:AggregatorBuild an empty aggregation.- Specified by:
buildEmptyAggregationin classAggregator
-
collectDebugInfo
Description copied from class:AggregatorCollect 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)andXContentBuilder.value(Object). And they'll have an integration test.- Overrides:
collectDebugInfoin classAggregator
-