Class Aggregator
- java.lang.Object
-
- org.elasticsearch.search.aggregations.BucketCollector
-
- org.elasticsearch.search.aggregations.Aggregator
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,org.apache.lucene.search.Collector
,Releasable
- Direct Known Subclasses:
AggregatorBase
,AggregatorFactory.MultiBucketAggregatorWrapper
,DeferringBucketCollector.WrappedAggregator
,ProfilingAggregator
public abstract class Aggregator extends BucketCollector implements Releasable
An Aggregator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Aggregator.Parser
Parses the aggregation request and creates the appropriate aggregator factory for it.static class
Aggregator.SubAggCollectionMode
Aggregation mode for sub aggregations.
-
Field Summary
-
Fields inherited from class org.elasticsearch.search.aggregations.BucketCollector
NO_OP_COLLECTOR
-
-
Constructor Summary
Constructors Constructor Description Aggregator()
-
Method Summary
Modifier and Type Method Description abstract InternalAggregation
buildAggregation(long bucket)
Build an aggregation for data that has been collected intobucket
.abstract InternalAggregation
buildEmptyAggregation()
Build an empty aggregation.abstract SearchContext
context()
Return theSearchContext
attached with thisAggregator
.static boolean
descendsFromBucketAggregator(Aggregator parent)
Returns whether one of the parents is aBucketsAggregator
.abstract java.lang.String
name()
Return the name of this aggregator.abstract Aggregator
parent()
Return the parent aggregator.abstract Aggregator
subAggregator(java.lang.String name)
Return the sub aggregator with the provided name.-
Methods inherited from class org.elasticsearch.search.aggregations.BucketCollector
getLeafCollector, postCollection, preCollection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.lease.Releasable
close
-
-
-
-
Method Detail
-
descendsFromBucketAggregator
public static boolean descendsFromBucketAggregator(Aggregator parent)
Returns whether one of the parents is aBucketsAggregator
.
-
name
public abstract java.lang.String name()
Return the name of this aggregator.
-
context
public abstract SearchContext context()
Return theSearchContext
attached with thisAggregator
.
-
parent
public abstract Aggregator parent()
Return the parent aggregator.
-
subAggregator
public abstract Aggregator subAggregator(java.lang.String name)
Return the sub aggregator with the provided name.
-
buildAggregation
public abstract InternalAggregation buildAggregation(long bucket) throws java.io.IOException
Build an aggregation for data that has been collected intobucket
.- Throws:
java.io.IOException
-
buildEmptyAggregation
public abstract InternalAggregation buildEmptyAggregation()
Build an empty aggregation.
-
-