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 ClassesModifier and TypeClassDescriptionstatic classInternalTerms.Bucket<B extends InternalTerms.Bucket<B>>Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms
AbstractInternalTerms.AbstractTermsBucketNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
InternalMultiBucketAggregation.InternalBucketNested classes/interfaces inherited from class org.elasticsearch.search.aggregations.InternalAggregation
InternalAggregation.ReduceContext, InternalAggregation.ReduceContextBuilderNested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFieldsNested 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.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic org.elasticsearch.common.xcontent.ParseFieldprotected longprotected BucketOrderprotected BucketOrderprotected intstatic org.elasticsearch.common.xcontent.ParseFieldFields inherited from class org.elasticsearch.search.aggregations.InternalAggregation
metadata, nameFields inherited from interface org.elasticsearch.search.aggregations.Aggregation
TYPED_KEYS_DELIMITERFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInternalTerms(String name, BucketOrder reduceOrder, BucketOrder order, int requiredSize, long minDocCount, Map<String,Object> metadata)Creates a newInternalTermsprotectedRead from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Acreate(String name, List<B> buckets, BucketOrder reduceOrder, long docCountError, long otherDocCount)Creates InternalTerms at the end of the mergeprotected voiddoWriteTo(StreamOutput out)booleanabstract BgetBucketByKey(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 longprotected BucketOrdergetOrder()protected BucketOrderprotected intprotected abstract intinthashCode()protected abstract voidsetDocCountError(long docCountError)protected abstract voidMethods inherited from class org.elasticsearch.search.aggregations.bucket.terms.AbstractInternalTerms
createBucket, doXContentCommon, getDocCountError, getSumOfOtherDocCounts, reduce, reduceBucketMethods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
copyWithRewritenBuckets, countInnerBucket, countInnerBucket, create, createBucket, forEachBucket, getProperty, mustReduceOnSingleInternalAgg, reducePipelinesMethods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
doXContentBody, getMetadata, getName, getProperty, getType, isMapped, mergePipelineTreeForBWCSerialization, pipelineAggregatorsForBwcSerialization, readSize, sortValue, sortValue, toString, toXContent, writeSize, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.Aggregation
getMetadata, getName, getTypeMethods inherited from interface org.elasticsearch.common.io.stream.NamedWriteable
getWriteableNameMethods inherited from interface org.elasticsearch.search.aggregations.bucket.terms.Terms
getDocCountError, getSumOfOtherDocCountsMethods inherited from interface org.elasticsearch.common.xcontent.ToXContent
toXContentMethods 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- TheBucketOrderthat should be used to merge shard results.order- TheBucketOrderthat 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:
doWriteToin classInternalAggregation- Throws:
IOException
-
writeTermTypeInfoTo
- Throws:
IOException
-
getBuckets
Description copied from interface:TermsReturn the sorted list of the buckets in this terms aggregation.- Specified by:
getBucketsin interfaceMultiBucketsAggregation- Specified by:
getBucketsin interfaceTerms- Specified by:
getBucketsin classInternalMultiBucketAggregation<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>- Returns:
- The buckets of this aggregation.
-
getBucketByKey
Description copied from interface:TermsGet the bucket for the given term, or null if there is no such bucket.- Specified by:
getBucketByKeyin interfaceTerms
-
getReduceOrder
- Specified by:
getReduceOrderin classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getOrder
- Specified by:
getOrderin classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getMinDocCount
protected long getMinDocCount()- Specified by:
getMinDocCountin classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getRequiredSize
protected int getRequiredSize()- Specified by:
getRequiredSizein classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
setDocCountError
protected abstract void setDocCountError(long docCountError)- Specified by:
setDocCountErrorin classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getShardSize
protected abstract int getShardSize()- Specified by:
getShardSizein 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:AbstractInternalTermsCreates InternalTerms at the end of the merge- Specified by:
createin classAbstractInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
equals
- Overrides:
equalsin classInternalAggregation
-
hashCode
public int hashCode()- Overrides:
hashCodein classInternalAggregation
-