Class InternalTerms.Bucket<B extends InternalTerms.Bucket<B>>
- java.lang.Object
-
- org.elasticsearch.search.aggregations.InternalMultiBucketAggregation.InternalBucket
-
- org.elasticsearch.search.aggregations.bucket.terms.InternalTerms.Bucket<B>
-
- All Implemented Interfaces:
Writeable,ToXContent,MultiBucketsAggregation.Bucket,Terms.Bucket,HasAggregations,KeyComparable<B>
- Direct Known Subclasses:
LongTerms.Bucket,StringTerms.Bucket,UnmappedTerms.Bucket
- Enclosing class:
- InternalTerms<A extends InternalTerms<A,B>,B extends InternalTerms.Bucket<B>>
public abstract static class InternalTerms.Bucket<B extends InternalTerms.Bucket<B>> extends InternalMultiBucketAggregation.InternalBucket implements Terms.Bucket, KeyComparable<B>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceInternalTerms.Bucket.Reader<B extends InternalTerms.Bucket<B>>Reads a bucket.-
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.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description protected InternalAggregationsaggregationsprotected longdocCountprotected longdocCountErrorprotected DocValueFormatformatprotected booleanshowDocCountError-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBucket(long docCount, InternalAggregations aggregations, boolean showDocCountError, long docCountError, DocValueFormat formatter)protectedBucket(StreamInput in, DocValueFormat formatter, boolean showDocCountError)Read from a stream.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)AggregationsgetAggregations()longgetDocCount()longgetDocCountError()inthashCode()protected abstract XContentBuilderkeyToXContent(XContentBuilder builder)Breduce(java.util.List<B> buckets, InternalAggregation.ReduceContext context)XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)protected abstract voidwriteTermTo(StreamOutput out)voidwriteTo(StreamOutput out)Write this into the StreamOutput.-
Methods inherited from class org.elasticsearch.search.aggregations.InternalMultiBucketAggregation.InternalBucket
getProperty
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.search.aggregations.KeyComparable
compareKey
-
Methods inherited from interface org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation.Bucket
getKey, getKeyAsString
-
Methods inherited from interface org.elasticsearch.search.aggregations.bucket.terms.Terms.Bucket
getKeyAsNumber
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContent
isFragment
-
-
-
-
Field Detail
-
docCount
protected long docCount
-
docCountError
protected long docCountError
-
aggregations
protected InternalAggregations aggregations
-
showDocCountError
protected final boolean showDocCountError
-
format
protected final DocValueFormat format
-
-
Constructor Detail
-
Bucket
protected Bucket(long docCount, InternalAggregations aggregations, boolean showDocCountError, long docCountError, DocValueFormat formatter)
-
Bucket
protected Bucket(StreamInput in, DocValueFormat formatter, boolean showDocCountError) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public final void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:WriteableWrite this into the StreamOutput.
-
writeTermTo
protected abstract void writeTermTo(StreamOutput out) throws java.io.IOException
- Throws:
java.io.IOException
-
getDocCount
public long getDocCount()
- Specified by:
getDocCountin interfaceMultiBucketsAggregation.Bucket- Returns:
- The number of documents that fall within this bucket
-
getDocCountError
public long getDocCountError()
- Specified by:
getDocCountErrorin interfaceTerms.Bucket
-
getAggregations
public Aggregations getAggregations()
- Specified by:
getAggregationsin interfaceHasAggregations- Specified by:
getAggregationsin interfaceMultiBucketsAggregation.Bucket- Returns:
- The sub-aggregations of this bucket
-
reduce
public B reduce(java.util.List<B> buckets, InternalAggregation.ReduceContext context)
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
java.io.IOException
-
keyToXContent
protected abstract XContentBuilder keyToXContent(XContentBuilder builder) throws java.io.IOException
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-