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
LeafBucketCollector
s which is generally faster than
FiltersAggregator.Compatible
but doesn't support when there is a parent aggregator
or any child aggregators.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
BuildsFilterByFilterAggregator
when 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.KeyedFilter
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
BucketsAggregator.BucketBuilderForFixedCount<B>, BucketsAggregator.BucketBuilderForVariable<B>, BucketsAggregator.ResultBuilderForVariable<B>, BucketsAggregator.SingleBucketResultBuilder
Nested 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, otherBucketKey
Fields inherited from class org.elasticsearch.search.aggregations.bucket.BucketsAggregator
docCountProvider
Fields inherited from class org.elasticsearch.search.aggregations.AggregatorBase
collectableSubAggregators, DEFAULT_WEIGHT, name, parent, subAggregators
Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Collect debug information to add to the profiling results.protected LeafBucketCollector
getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub)
Instead of returning aLeafBucketCollector
we do the collection ourselves by running the filters directly.Methods inherited from class org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator
build, buildAggregations, buildEmptyAggregation
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, rewriteBuckets
Methods 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, toString
Methods 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 aLeafBucketCollector
we do the collection ourselves by running the filters directly. This is safe because we only use this aggregator if there isn't aparent
which would change how we collect buckets and because we take the top level query into account when building the filters.- Specified by:
getLeafCollector
in classAggregatorBase
- Throws:
IOException
-
collectDebugInfo
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)
andXContentBuilder.value(Object)
. And they'll have an integration test.- Overrides:
collectDebugInfo
in classFiltersAggregator
-