Module org.elasticsearch.server
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
,Aggregation
,MultiBucketsAggregation
,SignificantTerms
,ToXContent
,ToXContentFragment
- 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.BucketAggregationList<B extends MultiBucketsAggregation.Bucket>, InternalMultiBucketAggregation.InternalBucket
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final long
protected final int
static final String
Fields inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
REPORT_EMPTY_EVERY
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.xcontent.ToXContent
EMPTY, 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 final void
doWriteTo
(StreamOutput out) boolean
finalizeSampling
(SamplingContext samplingContext) Called by the parent sampling context.protected AggregatorReducer
getLeaderReducer
(AggregationReduceContext reduceContext, int size) Return an object that Reduces several aggregations to a single one.protected abstract SignificanceHeuristic
protected abstract long
protected abstract long
int
hashCode()
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
canLeadReduction, doXContentBody, getMetadata, getName, getProperty, getReducer, getType, 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.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
SCORE
- See Also:
-
BG_COUNT
- See Also:
-
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.
-
getLeaderReducer
Description copied from class:InternalAggregation
Return an object that Reduces several aggregations to a single one. This method is called whenInternalAggregation.canLeadReduction()
returns true and expects an reducer that produces the right result.- Specified by:
getLeaderReducer
in classInternalAggregation
-
finalizeSampling
Description copied from class:InternalAggregation
Called by the parent sampling context. Should only ever be called once as some aggregations scale their internal values- Overrides:
finalizeSampling
in classInternalAggregation
- Parameters:
samplingContext
- the current sampling context- Returns:
- new aggregation with the sampling context applied, could be the same aggregation instance if nothing needs to be done
-
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
-