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
,ToXContent
,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 Classes Modifier and Type Class Description static class
InternalRareTerms.Bucket<B extends InternalRareTerms.Bucket<B>>
-
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
-
Nested classes/interfaces inherited from interface org.elasticsearch.search.aggregations.Aggregation
Aggregation.CommonFields
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.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
Fields Modifier and Type Field Description protected long
maxDocCount
protected BucketOrder
order
-
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
InternalRareTerms(java.lang.String name, BucketOrder order, long maxDocCount, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
protected
InternalRareTerms(StreamInput in)
Read from a stream.
-
Method Summary
Modifier and Type Method Description protected abstract B[]
createBucketsArray(int size)
Create an array to hold some buckets.protected abstract A
createWithFilter(java.lang.String name, java.util.List<B> buckets, SetBackedScalingCuckooFilter filter)
InternalAggregation
doReduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
protected void
doWriteTo(StreamOutput out)
protected static XContentBuilder
doXContentCommon(XContentBuilder builder, ToXContent.Params params, java.util.List<? extends InternalRareTerms.Bucket> buckets)
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.int
hashCode()
protected B
reduceBucket(java.util.List<B> buckets, InternalAggregation.ReduceContext context)
Reduce a list of same-keyed buckets (from multiple shards) to a single bucket.protected abstract void
writeTermTypeInfoTo(StreamOutput out)
-
Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
countInnerBucket, countInnerBucket, create, createBucket, getProperty
-
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
doXContentBody, getMetaData, getName, getProperty, getType, isMapped, pipelineAggregators, readSize, reduce, 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.common.xcontent.ToXContent
toXContent
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
order
protected final BucketOrder order
-
maxDocCount
protected final long maxDocCount
-
-
Constructor Detail
-
InternalRareTerms
protected InternalRareTerms(java.lang.String name, BucketOrder order, long maxDocCount, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData)
-
InternalRareTerms
protected InternalRareTerms(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
doWriteTo
protected final void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteTo
in classInternalAggregation
- Throws:
java.io.IOException
-
writeTermTypeInfoTo
protected abstract void writeTermTypeInfoTo(StreamOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
getBuckets
public abstract java.util.List<B> getBuckets()
Description copied from interface:RareTerms
Return the sorted list of the buckets in this terms aggregation.- Specified by:
getBuckets
in interfaceMultiBucketsAggregation
- Specified by:
getBuckets
in interfaceRareTerms
- Specified by:
getBuckets
in classInternalMultiBucketAggregation<A extends InternalRareTerms<A,B>,B extends InternalRareTerms.Bucket<B>>
- Returns:
- The buckets of this aggregation.
-
getBucketByKey
public abstract B getBucketByKey(java.lang.String term)
Description copied from interface:RareTerms
Get the bucket for the given term, or null if there is no such bucket.- Specified by:
getBucketByKey
in interfaceRareTerms
-
doReduce
public InternalAggregation doReduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
- Specified by:
doReduce
in classInternalAggregation
-
reduceBucket
protected B reduceBucket(java.util.List<B> buckets, InternalAggregation.ReduceContext context)
Description copied from class:InternalMultiBucketAggregation
Reduce a list of same-keyed buckets (from multiple shards) to a single bucket. This requires all buckets to have the same key.- Specified by:
reduceBucket
in classInternalMultiBucketAggregation<A extends InternalRareTerms<A,B>,B extends InternalRareTerms.Bucket<B>>
-
createWithFilter
protected abstract A createWithFilter(java.lang.String name, java.util.List<B> buckets, SetBackedScalingCuckooFilter filter)
-
createBucketsArray
protected abstract B[] createBucketsArray(int size)
Create an array to hold some buckets. Used in collecting the results.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classInternalAggregation
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classInternalAggregation
-
doXContentCommon
protected static XContentBuilder doXContentCommon(XContentBuilder builder, ToXContent.Params params, java.util.List<? extends InternalRareTerms.Bucket> buckets) throws java.io.IOException
- Throws:
java.io.IOException
-
-