Class FiltersAggregator.FilterByFilter
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.FiltersAggregator.FilterByFilter
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.apache.lucene.search.Collector
,Releasable
- Enclosing class:
- FiltersAggregator
public static class FiltersAggregator.FilterByFilter extends FiltersAggregator
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
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.filter.FiltersAggregator
FiltersAggregator.FilterByFilter, 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 Type Method Description void
collectDebugInfo(java.util.function.BiConsumer<java.lang.String,java.lang.Object> add)
Collect debug information to add to the profiling results.long
estimateCost(long maxCost)
Estimate the number of documents that this aggregation must visit.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, buildFilterOrderOrNull, buildWeights
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Method Details
-
estimateCost
public long estimateCost(long maxCost) throws java.io.IOExceptionEstimate the number of documents that this aggregation must visit. We'll stop counting once we've passedmaxEstimatedCost
if we aren't profiling.- Throws:
java.io.IOException
-
getLeafCollector
protected LeafBucketCollector getLeafCollector(org.apache.lucene.index.LeafReaderContext ctx, LeafBucketCollector sub) throws java.io.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:
java.io.IOException
-
collectDebugInfo
public void collectDebugInfo(java.util.function.BiConsumer<java.lang.String,java.lang.Object> 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)
andXContentBuilder.value(Object)
. And they'll have an integration test.- Overrides:
collectDebugInfo
in classAggregator
-