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>
bucketMap
protected java.util.List<B>
buckets
protected long
docCountError
protected DocValueFormat
format
protected long
otherDocCount
protected int
shardSize
protected boolean
showTermDocCountError
-
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 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)
protected
InternalMappedTerms(StreamInput in, InternalTerms.Bucket.Reader<B> bucketReader)
Read from a stream.
-
Method Summary
Modifier and Type Method Description protected boolean
doEquals(java.lang.Object obj)
Opportunity for subclasses to add criteria to theInternalAggregation.equals(Object)
method for this class.protected int
doHashCode()
Opportunity for subclasses to theInternalAggregation.hashCode()
for this class.XContentBuilder
doXContentBody(XContentBuilder builder, ToXContent.Params params)
B
getBucketByKey(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.long
getDocCountError()
Get an upper bound of the error on document counts in this aggregation.protected int
getShardSize()
long
getSumOfOtherDocCounts()
Return the sum of the document counts of all buckets that did not make it to the top buckets.protected void
setDocCountError(long docCountError)
protected void
writeTermTypeInfoTo(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:
writeTermTypeInfoTo
in classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
- Throws:
java.io.IOException
-
setDocCountError
protected void setDocCountError(long docCountError)
- Specified by:
setDocCountError
in classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getShardSize
protected int getShardSize()
- Specified by:
getShardSize
in classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
getDocCountError
public long getDocCountError()
Description copied from interface:Terms
Get an upper bound of the error on document counts in this aggregation.
-
getSumOfOtherDocCounts
public long getSumOfOtherDocCounts()
Description copied from interface:Terms
Return 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: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 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:Terms
Get the bucket for the given term, or null if there is no such bucket.- Specified by:
getBucketByKey
in interfaceTerms
- Specified by:
getBucketByKey
in classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
doEquals
protected boolean doEquals(java.lang.Object obj)
Description copied from class:InternalAggregation
Opportunity for subclasses to add criteria to theInternalAggregation.equals(Object)
method for this class. This method can safely castobj
to the subclass since theInternalAggregation.equals(Object)
method checks thatobj
is the same class asthis
- Overrides:
doEquals
in classInternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
-
doHashCode
protected int doHashCode()
Description copied from class:InternalAggregation
Opportunity for subclasses to theInternalAggregation.hashCode()
for this class.- Overrides:
doHashCode
in 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:
doXContentBody
in classInternalAggregation
- Throws:
java.io.IOException
-
-