Class StringTerms.Bucket
- java.lang.Object
-
- org.elasticsearch.search.aggregations.InternalMultiBucketAggregation.InternalBucket
-
- org.elasticsearch.search.aggregations.bucket.terms.InternalTerms.Bucket<StringTerms.Bucket>
-
- org.elasticsearch.search.aggregations.bucket.terms.StringTerms.Bucket
-
- All Implemented Interfaces:
Writeable
,ToXContent
,MultiBucketsAggregation.Bucket
,Terms.Bucket
,HasAggregations
,KeyComparable<StringTerms.Bucket>
- Enclosing class:
- StringTerms
public static class StringTerms.Bucket extends InternalTerms.Bucket<StringTerms.Bucket>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.bucket.terms.InternalTerms.Bucket
InternalTerms.Bucket.Reader<B extends InternalTerms.Bucket<B>>
-
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 inherited from class org.elasticsearch.search.aggregations.bucket.terms.InternalTerms.Bucket
aggregations, docCount, docCountError, format, showDocCountError
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description Bucket(org.apache.lucene.util.BytesRef term, long docCount, InternalAggregations aggregations, boolean showDocCountError, long docCountError, DocValueFormat format)
Bucket(StreamInput in, DocValueFormat format, boolean showDocCountError)
Read from a stream.
-
Method Summary
Modifier and Type Method Description int
compareKey(StringTerms.Bucket other)
Compare thisMultiBucketsAggregation.Bucket
skey
with another bucket.boolean
equals(java.lang.Object obj)
java.lang.Object
getKey()
java.lang.Number
getKeyAsNumber()
java.lang.String
getKeyAsString()
int
hashCode()
protected XContentBuilder
keyToXContent(XContentBuilder builder)
protected void
writeTermTo(StreamOutput out)
-
Methods inherited from class org.elasticsearch.search.aggregations.bucket.terms.InternalTerms.Bucket
getAggregations, getDocCount, getDocCountError, reduce, toXContent, writeTo
-
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.common.xcontent.ToXContent
isFragment
-
-
-
-
Constructor Detail
-
Bucket
public Bucket(org.apache.lucene.util.BytesRef term, long docCount, InternalAggregations aggregations, boolean showDocCountError, long docCountError, DocValueFormat format)
-
Bucket
public Bucket(StreamInput in, DocValueFormat format, boolean showDocCountError) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
writeTermTo
protected void writeTermTo(StreamOutput out) throws java.io.IOException
- Specified by:
writeTermTo
in classInternalTerms.Bucket<StringTerms.Bucket>
- Throws:
java.io.IOException
-
getKey
public java.lang.Object getKey()
- Returns:
- The key associated with the bucket
-
getKeyAsNumber
public java.lang.Number getKeyAsNumber()
-
getKeyAsString
public java.lang.String getKeyAsString()
- Returns:
- The key associated with the bucket as a string
-
compareKey
public int compareKey(StringTerms.Bucket other)
Description copied from interface:KeyComparable
Compare thisMultiBucketsAggregation.Bucket
skey
with another bucket.- Parameters:
other
- the bucket that contains the key to compare to.- Returns:
- a negative integer, zero, or a positive integer as this buckets key is less than, equal to, or greater than the other buckets key.
- See Also:
Comparable.compareTo(Object)
-
keyToXContent
protected final XContentBuilder keyToXContent(XContentBuilder builder) throws java.io.IOException
- Specified by:
keyToXContent
in classInternalTerms.Bucket<StringTerms.Bucket>
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classInternalTerms.Bucket<StringTerms.Bucket>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classInternalTerms.Bucket<StringTerms.Bucket>
-
-