Class InternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<A,B>
org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms<A,B>
org.elasticsearch.search.aggregations.bucket.terms.InternalTerms<A,B>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
,Aggregation
,MultiBucketsAggregation
,Terms
- Direct Known Subclasses:
InternalMappedTerms
,UnmappedTerms
public abstract class InternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>> extends AbstractInternalTerms<A,B> implements Terms
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InternalTerms.Bucket<B extends InternalTerms.Bucket<B>>
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms
AbstractInternalTerms.AbstractTermsBucket
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 Modifier and Type Field Description static org.elasticsearch.common.ParseField
DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME
protected long
minDocCount
protected BucketOrder
order
protected BucketOrder
reduceOrder
protected int
requiredSize
static org.elasticsearch.common.ParseField
SUM_OF_OTHER_DOC_COUNTS
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
Constructors Modifier Constructor Description protected
InternalTerms(java.lang.String name, BucketOrder reduceOrder, BucketOrder order, int requiredSize, long minDocCount, java.util.Map<java.lang.String,java.lang.Object> metadata)
Creates a newInternalTerms
protected
InternalTerms(StreamInput in)
Read from a stream. -
Method Summary
Modifier and Type Method Description protected abstract A
create(java.lang.String name, java.util.List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount)
Creates InternalTerms at the end of the mergeprotected void
doWriteTo(StreamOutput out)
boolean
equals(java.lang.Object obj)
abstract B
getBucketByKey(java.lang.String term)
Get the bucket for the given term, or null if there is no such bucket.abstract java.util.List<B>
getBuckets()
Return the sorted list of the buckets in this terms aggregation.protected long
getMinDocCount()
protected BucketOrder
getOrder()
protected BucketOrder
getReduceOrder()
protected int
getRequiredSize()
protected abstract int
getShardSize()
int
hashCode()
protected abstract void
setDocCountError(long docCountError)
protected abstract void
writeTermTypeInfoTo(StreamOutput out)
Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms
createBucket, createBucketsArray, doXContentCommon, getDocCountError, getSumOfOtherDocCounts, reduce, reduceBucket
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 org.elasticsearch.common.io.stream.NamedWriteable
getWriteableName
Methods inherited from interface org.elasticsearch.search.aggregations.bucket.terms.Terms
getDocCountError, getSumOfOtherDocCounts
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME
public static final org.elasticsearch.common.ParseField DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME -
SUM_OF_OTHER_DOC_COUNTS
public static final org.elasticsearch.common.ParseField SUM_OF_OTHER_DOC_COUNTS -
reduceOrder
-
order
-
requiredSize
protected final int requiredSize -
minDocCount
protected final long minDocCount
-
-
Constructor Details
-
InternalTerms
protected InternalTerms(java.lang.String name, BucketOrder reduceOrder, BucketOrder order, int requiredSize, long minDocCount, java.util.Map<java.lang.String,java.lang.Object> metadata)Creates a newInternalTerms
- Parameters:
name
- The name of the aggregationreduceOrder
- TheBucketOrder
that should be used to merge shard results.order
- TheBucketOrder
that should be used to sort the final reduce.requiredSize
- The number of top buckets.minDocCount
- The minimum number of documents allowed per bucket.metadata
- The metadata associated with the aggregation.
-
InternalTerms
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classInternalAggregation
- Throws:
java.io.IOException
-
writeTermTypeInfoTo
- Throws:
java.io.IOException
-
getBuckets
Description copied from interface:Terms
Return the sorted list of the buckets in this terms aggregation.- Specified by:
getBuckets
in interfaceMultiBucketsAggregation
- Specified by:
getBuckets
in interfaceTerms
- Specified by:
getBuckets
in classInternalMultiBucketAggregation<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
- Returns:
- The buckets of this aggregation.
-
getBucketByKey
Description copied from interface:Terms
Get the bucket for the given term, or null if there is no such bucket.- Specified by:
getBucketByKey
in interfaceTerms
-
getReduceOrder
- Specified by:
getReduceOrder
in classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getOrder
- Specified by:
getOrder
in classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getMinDocCount
protected long getMinDocCount()- Specified by:
getMinDocCount
in classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getRequiredSize
protected int getRequiredSize()- Specified by:
getRequiredSize
in classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
setDocCountError
protected abstract void setDocCountError(long docCountError)- Specified by:
setDocCountError
in classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getShardSize
protected abstract int getShardSize()- Specified by:
getShardSize
in classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
create
protected abstract A create(java.lang.String name, java.util.List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount)Description copied from class:AbstractInternalTerms
Creates InternalTerms at the end of the merge- Specified by:
create
in classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classInternalAggregation
-
hashCode
public int hashCode()- Overrides:
hashCode
in classInternalAggregation
-