Class InternalMappedTerms<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.InternalTerms<A,B>
-
- org.elasticsearch.search.aggregations.bucket.terms.InternalMappedTerms<A,B>
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,Aggregation,MultiBucketsAggregation,Terms
- Direct Known Subclasses:
DoubleTerms,LongTerms,StringTerms
public abstract class InternalMappedTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>> extends InternalTerms<A,B>
Common superclass for results of the terms aggregation on mapped fields.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.terms.InternalTerms
InternalTerms.Bucket<B extends InternalTerms.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 java.util.Map<java.lang.String,B>bucketMapprotected java.util.List<B>bucketsprotected longdocCountErrorprotected DocValueFormatformatprotected longotherDocCountprotected intshardSizeprotected booleanshowTermDocCountError-
Fields inherited from class org.elasticsearch.search.aggregations.bucket.terms.InternalTerms
DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME, minDocCount, order, requiredSize, 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 protectedInternalMappedTerms(java.lang.String name, BucketOrder order, int requiredSize, long minDocCount, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData, DocValueFormat format, int shardSize, boolean showTermDocCountError, long otherDocCount, java.util.List<B> buckets, long docCountError)protectedInternalMappedTerms(StreamInput in, InternalTerms.Bucket.Reader<B> bucketReader)Read from a stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoEquals(java.lang.Object obj)Opportunity for subclasses to add criteria to theInternalAggregation.equals(Object)method for this class.protected intdoHashCode()Opportunity for subclasses to theInternalAggregation.hashCode()for this class.XContentBuilderdoXContentBody(XContentBuilder builder, ToXContent.Params params)BgetBucketByKey(java.lang.String term)Get the bucket for the given term, or null if there is no such bucket.java.util.List<B>getBuckets()Return the sorted list of the buckets in this terms aggregation.longgetDocCountError()Get an upper bound of the error on document counts in this aggregation.protected intgetShardSize()longgetSumOfOtherDocCounts()Return the sum of the document counts of all buckets that did not make it to the top buckets.protected voidsetDocCountError(long docCountError)protected voidwriteTermTypeInfoTo(StreamOutput out)-
Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.InternalTerms
create, createBucketsArray, doReduce, doWriteTo, doXContentCommon
-
Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation
countInnerBucket, countInnerBucket, create, createBucket, getProperty
-
Methods inherited from class org.elasticsearch.search.aggregations.InternalAggregation
equals, getMetaData, getName, getProperty, getType, hashCode, 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
-
format
protected final DocValueFormat format
-
shardSize
protected final int shardSize
-
showTermDocCountError
protected final boolean showTermDocCountError
-
otherDocCount
protected final long otherDocCount
-
buckets
protected final java.util.List<B extends InternalTerms.Bucket<B>> buckets
-
bucketMap
protected java.util.Map<java.lang.String,B extends InternalTerms.Bucket<B>> bucketMap
-
docCountError
protected long docCountError
-
-
Constructor Detail
-
InternalMappedTerms
protected InternalMappedTerms(java.lang.String name, BucketOrder order, int requiredSize, long minDocCount, java.util.List<PipelineAggregator> pipelineAggregators, java.util.Map<java.lang.String,java.lang.Object> metaData, DocValueFormat format, int shardSize, boolean showTermDocCountError, long otherDocCount, java.util.List<B> buckets, long docCountError)
-
InternalMappedTerms
protected InternalMappedTerms(StreamInput in, InternalTerms.Bucket.Reader<B> bucketReader) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
writeTermTypeInfoTo
protected final void writeTermTypeInfoTo(StreamOutput out) throws java.io.IOException
- Specified by:
writeTermTypeInfoToin classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>- Throws:
java.io.IOException
-
setDocCountError
protected void setDocCountError(long docCountError)
- Specified by:
setDocCountErrorin classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getShardSize
protected int getShardSize()
- Specified by:
getShardSizein classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getDocCountError
public long getDocCountError()
Description copied from interface:TermsGet an upper bound of the error on document counts in this aggregation.
-
getSumOfOtherDocCounts
public long getSumOfOtherDocCounts()
Description copied from interface:TermsReturn the sum of the document counts of all buckets that did not make it to the top buckets.
-
getBuckets
public java.util.List<B> 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 classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>- Returns:
- The buckets of this aggregation.
-
getBucketByKey
public B getBucketByKey(java.lang.String term)
Description copied from interface:TermsGet the bucket for the given term, or null if there is no such bucket.- Specified by:
getBucketByKeyin interfaceTerms- Specified by:
getBucketByKeyin classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
doEquals
protected boolean doEquals(java.lang.Object obj)
Description copied from class:InternalAggregationOpportunity for subclasses to add criteria to theInternalAggregation.equals(Object)method for this class. This method can safely castobjto the subclass since theInternalAggregation.equals(Object)method checks thatobjis the same class asthis- Overrides:
doEqualsin classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
doHashCode
protected int doHashCode()
Description copied from class:InternalAggregationOpportunity for subclasses to theInternalAggregation.hashCode()for this class.- Overrides:
doHashCodein classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
doXContentBody
public final XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
doXContentBodyin classInternalAggregation- Throws:
java.io.IOException
-
-