Class InternalSignificantTerms<A extends InternalSignificantTerms<A,B>,B extends InternalSignificantTerms.Bucket<B>>
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<A,B>
org.elasticsearch.search.aggregations.bucket.terms.InternalSignificantTerms<A,B>
- All Implemented Interfaces:
Iterable<SignificantTerms.Bucket>
,NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
,Aggregation
,MultiBucketsAggregation
,SignificantTerms
- Direct Known Subclasses:
InternalMappedSignificantTerms
,UnmappedSignificantTerms
public abstract class InternalSignificantTerms<A extends InternalSignificantTerms<A,B>,B extends InternalSignificantTerms.Bucket<B>>
extends InternalMultiBucketAggregation<A,B>
implements SignificantTerms
Result of the significant terms aggregation.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
InternalMultiBucketAggregation.InternalBucket
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContext, InternalAggregation.ReduceContextBuilder
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metadata, name
Fields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITER
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionprotected
InternalSignificantTerms(String name, int requiredSize, long minDocCount, Map<String,Object> metadata)
protected
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract A
protected abstract B[]
createBucketsArray(int size)
Create an array to hold some buckets.protected void
doWriteTo(StreamOutput out)
boolean
protected abstract SignificanceHeuristic
protected abstract long
protected abstract long
int
hashCode()
reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
Reduces the given aggregations to a single one and returns it.protected B
reduceBucket(List<B> buckets, InternalAggregation.ReduceContext context)
Reduce a list of same-keyed buckets (from multiple shards) to a single bucket.protected abstract void
Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
copyWithRewritenBuckets, countInnerBucket, countInnerBucket, create, createBucket, forEachBucket, getProperty, mustReduceOnSingleInternalAgg, reducePipelines
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
doXContentBody, getMetadata, getName, getProperty, getType, isMapped, mergePipelineTreeForBWCSerialization, pipelineAggregatorsForBwcSerialization, readSize, sortValue, sortValue, toString, toXContent, writeSize, writeTo
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetadata, getName, getType
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
Methods inherited from interface org.elasticsearch.search.aggregations.bucket.terms.SignificantTerms
getBucketByKey
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
SCORE
- See Also:
- Constant Field Values
-
BG_COUNT
- See Also:
- Constant Field Values
-
requiredSize
protected final int requiredSize -
minDocCount
protected final long minDocCount
-
-
Constructor Details
-
InternalSignificantTerms
-
InternalSignificantTerms
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classInternalAggregation
- Throws:
IOException
-
writeTermTypeInfoTo
- Throws:
IOException
-
getBuckets
- Specified by:
getBuckets
in interfaceMultiBucketsAggregation
- Specified by:
getBuckets
in interfaceSignificantTerms
- Specified by:
getBuckets
in classInternalMultiBucketAggregation<A extends InternalSignificantTerms<A,B>,B extends InternalSignificantTerms.Bucket<B>>
- Returns:
- The buckets of this aggregation.
-
reduce
public InternalAggregation reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Description copied from class:InternalAggregation
Reduces the given aggregations to a single one and returns it. In most cases, the assumption will be the all given aggregations are of the same type (the same type as this aggregation). For best efficiency, when implementing, try reusing an existing instance (typically the first in the given list) to save on redundant object construction.- Specified by:
reduce
in classInternalAggregation
- See Also:
InternalAggregation.mustReduceOnSingleInternalAgg()
-
reduceBucket
Description copied from class:InternalMultiBucketAggregation
Reduce a list of same-keyed buckets (from multiple shards) to a single bucket. This requires all buckets to have the same key.- Specified by:
reduceBucket
in classInternalMultiBucketAggregation<A extends InternalSignificantTerms<A,B>,B extends InternalSignificantTerms.Bucket<B>>
-
create
-
createBucketsArray
Create an array to hold some buckets. Used in collecting the results. -
getSubsetSize
protected abstract long getSubsetSize() -
getSupersetSize
protected abstract long getSupersetSize() -
getSignificanceHeuristic
-
hashCode
public int hashCode()- Overrides:
hashCode
in classInternalAggregation
-
equals
- Overrides:
equals
in classInternalAggregation
-