Class InternalRareTerms<A extends InternalRareTerms<A,B>,B extends InternalRareTerms.Bucket<B>>
java.lang.Object
org.elasticsearch.search.aggregations.InternalAggregation
org.elasticsearch.search.aggregations.InternalMultiBucketAggregation<A,B>
org.elasticsearch.search.aggregations.bucket.terms.InternalRareTerms<A,B>
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,Aggregation,MultiBucketsAggregation,RareTerms
- Direct Known Subclasses:
InternalMappedRareTerms,UnmappedRareTerms
public abstract class InternalRareTerms<A extends InternalRareTerms<A,B>,B extends InternalRareTerms.Bucket<B>>
extends InternalMultiBucketAggregation<A,B>
implements RareTerms
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInternalRareTerms.Bucket<B extends InternalRareTerms.Bucket<B>>Nested 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
FieldsFields 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
ConstructorsModifierConstructorDescriptionprotectedInternalRareTerms(String name, BucketOrder order, long maxDocCount, Map<String,Object> metadata)protectedRead from a stream. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract B[]createBucketsArray(int size)Create an array to hold some buckets.protected abstract AcreateWithFilter(String name, List<B> buckets, SetBackedScalingCuckooFilter filter)protected voiddoWriteTo(StreamOutput out)protected static org.elasticsearch.common.xcontent.XContentBuilderdoXContentCommon(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params, List<? extends InternalRareTerms.Bucket> buckets)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.inthashCode()reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Reduces the given aggregations to a single one and returns it.protected BreduceBucket(List<B> buckets, InternalAggregation.ReduceContext context)Reduce a list of same-keyed buckets (from multiple shards) to a single bucket.protected abstract voidMethods 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.common.xcontent.ToXContent
toXContentMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
order
-
maxDocCount
protected final long maxDocCount
-
-
Constructor Details
-
InternalRareTerms
protected InternalRareTerms(String name, BucketOrder order, long maxDocCount, Map<String,Object> metadata) -
InternalRareTerms
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteToin classInternalAggregation- Throws:
IOException
-
writeTermTypeInfoTo
- Throws:
IOException
-
getBuckets
Description copied from interface:RareTermsReturn the sorted list of the buckets in this terms aggregation.- Specified by:
getBucketsin interfaceMultiBucketsAggregation- Specified by:
getBucketsin interfaceRareTerms- Specified by:
getBucketsin classInternalMultiBucketAggregation<A extends InternalRareTerms<A,B>,B extends InternalRareTerms.Bucket<B>>- Returns:
- The buckets of this aggregation.
-
getBucketByKey
Description copied from interface:RareTermsGet the bucket for the given term, or null if there is no such bucket.- Specified by:
getBucketByKeyin interfaceRareTerms
-
reduce
public InternalAggregation reduce(List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)Description copied from class:InternalAggregationReduces 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:
reducein classInternalAggregation- See Also:
InternalAggregation.mustReduceOnSingleInternalAgg()
-
reduceBucket
Description copied from class:InternalMultiBucketAggregationReduce a list of same-keyed buckets (from multiple shards) to a single bucket. This requires all buckets to have the same key.- Specified by:
reduceBucketin classInternalMultiBucketAggregation<A extends InternalRareTerms<A,B>,B extends InternalRareTerms.Bucket<B>>
-
createWithFilter
protected abstract A createWithFilter(String name, List<B> buckets, SetBackedScalingCuckooFilter filter) -
createBucketsArray
Create an array to hold some buckets. Used in collecting the results. -
equals
- Overrides:
equalsin classInternalAggregation
-
hashCode
public int hashCode()- Overrides:
hashCodein classInternalAggregation
-
doXContentCommon
protected static org.elasticsearch.common.xcontent.XContentBuilder doXContentCommon(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params, List<? extends InternalRareTerms.Bucket> buckets) throws IOException- Throws:
IOException
-