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
Modifier and TypeClassDescriptionstatic 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
Modifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ParseField
protected long
protected BucketOrder
protected BucketOrder
protected int
static org.elasticsearch.common.xcontent.ParseField
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
InternalTerms(String name, BucketOrder reduceOrder, BucketOrder order, int requiredSize, long minDocCount, Map<String,Object> metadata)
Creates a newInternalTerms
protected
Read from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract A
create(String name, List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount)
Creates InternalTerms at the end of the mergeprotected void
doWriteTo(StreamOutput out)
boolean
abstract B
getBucketByKey(String term)
Get the bucket for the given term, or null if there is no such bucket.Return the sorted list of the buckets in this terms aggregation.protected long
protected BucketOrder
getOrder()
protected BucketOrder
protected int
protected abstract int
int
hashCode()
protected abstract void
setDocCountError(long docCountError)
protected abstract void
Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms
createBucket, 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.xcontent.ParseField DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME -
SUM_OF_OTHER_DOC_COUNTS
public static final org.elasticsearch.common.xcontent.ParseField SUM_OF_OTHER_DOC_COUNTS -
reduceOrder
-
order
-
requiredSize
protected final int requiredSize -
minDocCount
protected final long minDocCount
-
-
Constructor Details
-
InternalTerms
protected InternalTerms(String name, BucketOrder reduceOrder, BucketOrder order, int requiredSize, long minDocCount, Map<String,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:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classInternalAggregation
- Throws:
IOException
-
writeTermTypeInfoTo
- Throws:
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(String name, 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
- Overrides:
equals
in classInternalAggregation
-
hashCode
public int hashCode()- Overrides:
hashCode
in classInternalAggregation
-