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,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,Rewriteable<AggregationBuilder>,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.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.ParamsNested 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 booleankeyedprotected InternalRange.Factory<?,?>rangeFactoryprotected java.util.List<R>rangesFields inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
configFields inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
metadataFields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
DEFAULT_PREALLOCATION, factoriesBuilder, nameFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractRangeBuilder(java.lang.String name, InternalRange.Factory<?,?> rangeFactory)protectedAbstractRangeBuilder(StreamInput in, InternalRange.Factory<?,?> rangeFactory, Writeable.Reader<R> rangeReader)Read from a stream.protectedAbstractRangeBuilder(AbstractRangeBuilder<AB,R> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) -
Method Summary
Modifier and Type Method Description ABaddRange(R range)AggregationBuilder.BucketCardinalitybucketCardinality()A rough count of the number of buckets thatAggregators built by this builder will contain per owning parent bucket.protected ValuesSourceTypedefaultValueSourceType()Aggregations should use this method to define aValuesSourceTypeof last resort.protected org.elasticsearch.common.xcontent.XContentBuilderdoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)booleanequals(java.lang.Object obj)inthashCode()protected voidinnerWriteTo(StreamOutput out)Write subclass's state to the stream.booleankeyed()ABkeyed(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, declareFields, doBuild, doWriteTo, field, field, format, format, getRegistryKey, innerBuild, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, userValueTypeHint, userValueTypeHintMethods inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
build, getMetadata, getWriteableName, setMetadata, subAggregation, subAggregation, subAggregations, toXContent, writeToMethods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
buildPipelineTree, bytesToPreallocate, doRewrite, getName, getOutputFieldNames, getPipelineAggregations, getSubAggregations, rewrite, shallowCopy, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.search.aggregations.BaseAggregationBuilder
getTypeMethods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
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:ValuesSourceAggregationBuilderAggregations should use this method to define aValuesSourceTypeof 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:
defaultValueSourceTypein 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:ValuesSourceAggregationBuilderWrite subclass's state to the stream.- Specified by:
innerWriteToin classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>- Throws:
java.io.IOException
-
addRange
-
ranges
-
keyed
-
keyed
public boolean keyed() -
bucketCardinality
Description copied from class:AggregationBuilderA rough count of the number of buckets thatAggregators built by this builder will contain per owning parent bucket.- Specified by:
bucketCardinalityin classAggregationBuilder
-
doXContentBody
protected org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
doXContentBodyin classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
-