Class FilterByFilterAggregator
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
org.elasticsearch.search.aggregations.bucket.filter.FilterByFilterAggregator
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.lucene.search.Collector,org.elasticsearch.core.Releasable
Collects results by running each filter against the searcher and doesn't
build any
LeafBucketCollectors which is generally faster than
FiltersAggregator.Compatible but doesn't support when there is a parent aggregator
or any child aggregators.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuildsFilterByFilterAggregatorwhen the filters are valid and it would be faster than a "native" aggregation implementation.Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator
FiltersAggregator.KeyedFilterNested 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
Fields inherited from class org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator
FILTERS_FIELD, OTHER_BUCKET_FIELD, OTHER_BUCKET_KEY_FIELD, otherBucketKeyFields 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 TypeMethodDescriptionvoidCollect debug information to add to the profiling results.protected LeafBucketCollectorgetLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub)Instead of returning aLeafBucketCollectorwe do the collection ourselves by running the filters directly.Methods inherited from class org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator
build, buildAggregations, buildEmptyAggregationMethods 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, metadata, name, parent, pointReaderIfAvailable, postCollection, preCollection, scoreMode, searcher, subAggregator, subAggregators, topLevelQuery, toStringMethods inherited from class org.elasticsearch.search.aggregations.Aggregator
buildTopLevel, resolveSortPathOnValidAgg
-
Method Details
-
getLeafCollector
protected LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub) throws IOExceptionInstead of returning aLeafBucketCollectorwe do the collection ourselves by running the filters directly. This is safe because we only use this aggregator if there isn't aparentwhich would change how we collect buckets and because we take the top level query into account when building the filters.- Specified by:
getLeafCollectorin classAggregatorBase- Throws:
IOException
-
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 classFiltersAggregator
-