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 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
Modifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ParseField
static org.elasticsearch.common.xcontent.ParseField
static org.elasticsearch.common.xcontent.ParseField
protected String
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 TypeMethodDescriptionstatic FiltersAggregator
build(String name, AggregatorFactories factories, List<QueryToFilterAdapter<?>> filters, boolean keyed, String otherBucketKey, AggregationContext context, Aggregator parent, CardinalityUpperBound cardinality, Map<String,Object> metadata)
Build anAggregator
for afilters
aggregation.buildAggregations(long[] owningBucketOrds)
Build the results of this aggregation.Build an empty aggregation.void
Collect 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, rewriteBuckets
Methods 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, toString
Methods 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 anAggregator
for afilters
aggregation. If there isn't a parent, there aren't children, and we don't collect "other" buckets then this will a fasterFilterByFilterAggregator
aggregator. Otherwise it'll fall back to a slower aggregator that isFiltersAggregator.Compatible
with parent, children, and "other" buckets.- Throws:
IOException
-
buildAggregations
Description copied from class:Aggregator
Build the results of this aggregation.- Specified by:
buildAggregations
in 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:Aggregator
Build an empty aggregation.- Specified by:
buildEmptyAggregation
in classAggregator
-
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 classAggregator
-