public abstract class InternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>> extends InternalMultiBucketAggregation<A,B> implements Terms
Modifier and Type | Class and Description |
---|---|
static class |
InternalTerms.Bucket<B extends InternalTerms.Bucket<B>> |
InternalMultiBucketAggregation.InternalBucket
InternalAggregation.ReduceContext
Aggregation.CommonFields
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Writeable.Reader<V>, Writeable.Writer<V>
Modifier and Type | Field and Description |
---|---|
protected static ParseField |
DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME |
protected long |
minDocCount |
protected BucketOrder |
order |
protected int |
requiredSize |
protected static ParseField |
SUM_OF_OTHER_DOC_COUNTS |
metaData, name
TYPED_KEYS_DELIMITER
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
InternalTerms(StreamInput in)
Read from a stream.
|
protected |
InternalTerms(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) |
Modifier and Type | Method and Description |
---|---|
protected abstract A |
create(java.lang.String name,
java.util.List<B> buckets,
long docCountError,
long otherDocCount) |
protected abstract B[] |
createBucketsArray(int size)
Create an array to hold some buckets.
|
protected boolean |
doEquals(java.lang.Object obj)
Opportunity for subclasses to add criteria to the
InternalAggregation.equals(Object)
method for this class. |
protected int |
doHashCode()
Opportunity for subclasses to the
InternalAggregation.hashCode() for this
class. |
InternalAggregation |
doReduce(java.util.List<InternalAggregation> aggregations,
InternalAggregation.ReduceContext reduceContext) |
protected void |
doWriteTo(StreamOutput out) |
protected static XContentBuilder |
doXContentCommon(XContentBuilder builder,
ToXContent.Params params,
long docCountError,
long otherDocCount,
java.util.List<? extends InternalTerms.Bucket> buckets) |
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.
|
protected abstract int |
getShardSize() |
protected abstract void |
setDocCountError(long docCountError) |
protected abstract void |
writeTermTypeInfoTo(StreamOutput out) |
create, createBucket, getProperty
doXContentBody, equals, getMetaData, getName, getProperty, getType, hashCode, pipelineAggregators, readSize, reduce, toString, toXContent, writeSize, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDocCountError, getSumOfOtherDocCounts
getMetaData, getName, getType
isFragment, toXContent
getWriteableName
protected static final ParseField DOC_COUNT_ERROR_UPPER_BOUND_FIELD_NAME
protected static final ParseField SUM_OF_OTHER_DOC_COUNTS
protected final BucketOrder order
protected final int requiredSize
protected final long minDocCount
protected InternalTerms(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)
protected InternalTerms(StreamInput in) throws java.io.IOException
java.io.IOException
protected final void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class InternalAggregation
java.io.IOException
protected abstract void writeTermTypeInfoTo(StreamOutput out) throws java.io.IOException
java.io.IOException
public abstract java.util.List<B> getBuckets()
Terms
getBuckets
in interface MultiBucketsAggregation
getBuckets
in interface Terms
getBuckets
in class InternalMultiBucketAggregation<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
public abstract B getBucketByKey(java.lang.String term)
Terms
getBucketByKey
in interface Terms
public InternalAggregation doReduce(java.util.List<InternalAggregation> aggregations, InternalAggregation.ReduceContext reduceContext)
doReduce
in class InternalAggregation
protected abstract void setDocCountError(long docCountError)
protected abstract int getShardSize()
protected abstract A create(java.lang.String name, java.util.List<B> buckets, long docCountError, long otherDocCount)
protected abstract B[] createBucketsArray(int size)
protected boolean doEquals(java.lang.Object obj)
InternalAggregation
InternalAggregation.equals(Object)
method for this class.
This method can safely cast obj
to the subclass since the
InternalAggregation.equals(Object)
method checks that obj
is the same
class as this
doEquals
in class InternalAggregation
protected int doHashCode()
InternalAggregation
InternalAggregation.hashCode()
for this
class.doHashCode
in class InternalAggregation
protected static XContentBuilder doXContentCommon(XContentBuilder builder, ToXContent.Params params, long docCountError, long otherDocCount, java.util.List<? extends InternalTerms.Bucket> buckets) throws java.io.IOException
java.io.IOException