Class AbstractRangeBuilder<AB extends AbstractRangeBuilder<AB,R>,R extends RangeAggregator.Range>
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder<AB>
org.elasticsearch.search.aggregations.bucket.range.AbstractRangeBuilder<AB,R>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,ToXContent
,ToXContentFragment
,BaseAggregationBuilder
- Direct Known Subclasses:
DateRangeAggregationBuilder
,RangeAggregationBuilder
public abstract class AbstractRangeBuilder<AB extends AbstractRangeBuilder<AB,R>,R extends RangeAggregator.Range> extends ValuesSourceAggregationBuilder<AB>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<AB>>
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
AggregationBuilder.BucketCardinality, AggregationBuilder.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 boolean
keyed
protected InternalRange.Factory<?,?>
rangeFactory
protected java.util.List<R>
ranges
Fields inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
config
Fields inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
metadata
Fields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
factoriesBuilder, name
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRangeBuilder(java.lang.String name, InternalRange.Factory<?,?> rangeFactory)
protected
AbstractRangeBuilder(StreamInput in, InternalRange.Factory<?,?> rangeFactory, Writeable.Reader<R> rangeReader)
Read from a stream.protected
AbstractRangeBuilder(AbstractRangeBuilder<AB,R> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata)
-
Method Summary
Modifier and Type Method Description AB
addRange(R range)
AggregationBuilder.BucketCardinality
bucketCardinality()
Do aggregations built by this builder contain buckets? If so, do they contain *always* contain a single bucket?protected ValuesSourceType
defaultValueSourceType()
Aggregations should use this method to define aValuesSourceType
of last resort.protected XContentBuilder
doXContentBody(XContentBuilder builder, ToXContent.Params params)
boolean
equals(java.lang.Object obj)
int
hashCode()
protected void
innerWriteTo(StreamOutput out)
Write subclass's state to the stream.boolean
keyed()
AB
keyed(boolean keyed)
protected RangeAggregator.Range[]
processRanges(java.util.function.Function<RangeAggregator.Range,RangeAggregator.Range> rangeProcessor)
Resolve any strings in the ranges so we have a number value for the from and to of each range.java.util.List<R>
ranges()
Methods inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
declareFields, doBuild, doWriteTo, field, field, format, format, innerBuild, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, userValueTypeHint, userValueTypeHint
Methods inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
build, getMetadata, getWriteableName, setMetadata, subAggregation, subAggregation, subAggregations, toXContent, writeTo
Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
buildPipelineTree, doRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, shallowCopy, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getType
-
Field Details
-
rangeFactory
-
ranges
-
keyed
protected boolean keyed
-
-
Constructor Details
-
AbstractRangeBuilder
-
AbstractRangeBuilder
protected AbstractRangeBuilder(AbstractRangeBuilder<AB,R> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) -
AbstractRangeBuilder
protected AbstractRangeBuilder(StreamInput in, InternalRange.Factory<?,?> rangeFactory, Writeable.Reader<R> rangeReader) throws java.io.IOExceptionRead from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
defaultValueSourceType
Description copied from class:ValuesSourceAggregationBuilder
Aggregations should use this method to define aValuesSourceType
of last resort. This will only be used when the resolver can't find a field and the user hasn't provided a value type hint.- Specified by:
defaultValueSourceType
in classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
- Returns:
- The CoreValuesSourceType we expect this script to yield.
-
processRanges
protected RangeAggregator.Range[] processRanges(java.util.function.Function<RangeAggregator.Range,RangeAggregator.Range> rangeProcessor)Resolve any strings in the ranges so we have a number value for the from and to of each range. The ranges are also sorted before being returned. -
innerWriteTo
Description copied from class:ValuesSourceAggregationBuilder
Write subclass's state to the stream.- Specified by:
innerWriteTo
in classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
- Throws:
java.io.IOException
-
addRange
-
ranges
-
keyed
-
keyed
public boolean keyed() -
bucketCardinality
Description copied from class:AggregationBuilder
Do aggregations built by this builder contain buckets? If so, do they contain *always* contain a single bucket?- Specified by:
bucketCardinality
in classAggregationBuilder
-
doXContentBody
protected XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
doXContentBody
in classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCode
in classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equals
in classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
-