Module org.elasticsearch.server
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,VersionedNamedWriteable,Writeable,Rewriteable<AggregationBuilder>,BaseAggregationBuilder,ToXContent,ToXContentFragment
- 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<AB extends ValuesSourceAggregationBuilder<AB>>, ValuesSourceAggregationBuilder.MetricsAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>>, ValuesSourceAggregationBuilder.SingleMetricAggregationBuilder<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.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields 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.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRangeBuilder(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, Map<String, Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionA rough count of the number of buckets thatAggregators built by this builder will contain per owning parent bucket.protected ValuesSourceTypeAggregations should use this method to define aValuesSourceTypeof last resort.protected XContentBuilderdoXContentBody(XContentBuilder builder, ToXContent.Params params) booleaninthashCode()protected voidinnerWriteTo(StreamOutput out) Write subclass's state to the stream.booleankeyed()keyed(boolean keyed) protected RangeAggregator.Range[]processRanges(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.ranges()booleanDoes this aggregation support running with in a sampling context.Methods inherited from class org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder
declareFields, declareFields, doBuild, doWriteTo, field, field, format, format, innerBuild, internalXContent, 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, deepCopy, doRewrite, getName, getOutputFieldNames, getPipelineAggregations, getQuery, getSubAggregations, isInSortOrderExecutionRequired, rewrite, shallowCopy, supportsParallelCollection, toString, validateSequentiallyOrdered, validateSequentiallyOrderedWithoutGapsMethods 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.xcontent.ToXContentFragment
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
getMinimalSupportedVersion
-
Field Details
-
rangeFactory
-
ranges
-
keyed
protected boolean keyed
-
-
Constructor Details
-
AbstractRangeBuilder
-
AbstractRangeBuilder
protected AbstractRangeBuilder(AbstractRangeBuilder<AB, R> clone, AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) -
AbstractRangeBuilder
protected AbstractRangeBuilder(StreamInput in, InternalRange.Factory<?, ?> rangeFactory, Writeable.Reader<R> rangeReader) throws IOExceptionRead from a stream.- Throws:
IOException
-
-
Method Details
-
supportsSampling
public boolean supportsSampling()Description copied from class:AggregationBuilderDoes this aggregation support running with in a sampling context. By default, it's false for all aggregations. If the sub-classed builder supports sampling, be sure of the following that the resulting internal aggregation objects override theInternalAggregation.finalizeSampling(SamplingContext)and scales any values that require scaling.- Overrides:
supportsSamplingin classAggregationBuilder- Returns:
- does this aggregation builder support sampling
-
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(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:
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 XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
doXContentBodyin classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>> - Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
-
equals
- Overrides:
equalsin classValuesSourceAggregationBuilder<AB extends AbstractRangeBuilder<AB,R>>
-