Class ValuesSourceAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>>
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder<AB>
- All Implemented Interfaces:
NamedWriteable,Writeable,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment,Rewriteable<AggregationBuilder>,BaseAggregationBuilder
- Direct Known Subclasses:
AbstractRangeBuilder,AutoDateHistogramAggregationBuilder,DateHistogramAggregationBuilder,DiversifiedAggregationBuilder,GeoBoundsAggregationBuilder,GeoDistanceAggregationBuilder,GeoGridAggregationBuilder,HistogramAggregationBuilder,IpRangeAggregationBuilder,MissingAggregationBuilder,RareTermsAggregationBuilder,SignificantTermsAggregationBuilder,TermsAggregationBuilder,ValuesSourceAggregationBuilder.LeafOnly,VariableWidthHistogramAggregationBuilder
public abstract class ValuesSourceAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>> extends AbstractAggregationBuilder<AB>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValuesSourceAggregationBuilder.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 ValuesSourceConfigconfigFields inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
metadataFields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
factoriesBuilder, name -
Constructor Summary
Constructors Modifier Constructor Description protectedValuesSourceAggregationBuilder(java.lang.String name)protectedValuesSourceAggregationBuilder(StreamInput in)Read from a stream.protectedValuesSourceAggregationBuilder(ValuesSourceAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) -
Method Summary
Modifier and Type Method Description static <T> voiddeclareFields(org.elasticsearch.common.xcontent.AbstractObjectParser<? extends ValuesSourceAggregationBuilder<?>,T> objectParser, boolean scriptable, boolean formattable, boolean timezoneAware)protected abstract ValuesSourceTypedefaultValueSourceType()Aggregations should use this method to define aValuesSourceTypeof last resort.protected ValuesSourceAggregatorFactorydoBuild(QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)protected voiddoWriteTo(StreamOutput out)protected abstract org.elasticsearch.common.xcontent.XContentBuilderdoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)booleanequals(java.lang.Object obj)java.lang.Stringfield()Gets the field to use for this aggregation.ABfield(java.lang.String field)Sets the field to use for this aggregation.java.lang.Stringformat()Gets the format to use for the output of the aggregation.ABformat(java.lang.String format)Sets the format to use for the output of the aggregation.inthashCode()protected abstract ValuesSourceAggregatorFactoryinnerBuild(QueryShardContext queryShardContext, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)protected abstract voidinnerWriteTo(StreamOutput out)Write subclass's state to the stream.org.elasticsearch.common.xcontent.XContentBuilderinternalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)java.lang.Objectmissing()Gets the value to use when the aggregation finds a missing value in a documentABmissing(java.lang.Object missing)Sets the value to use when the aggregation finds a missing value in a documentprotected ValuesSourceConfigresolveConfig(QueryShardContext queryShardContext)Scriptscript()Gets the script to use for this aggregation.ABscript(Script script)Sets the script to use for this aggregation.protected booleanserializeTargetValueType(Version version)DO NOT OVERRIDE THIS! This method only exists for legacy support.java.time.ZoneIdtimeZone()Gets the time zone to use for this aggregationABtimeZone(java.time.ZoneId timeZone)Sets the time zone to use for this aggregationValueTypeuserValueTypeHint()ABuserValueTypeHint(ValueType valueType)This setter should only be used during parsing, to set the userValueTypeHint.Methods 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
bucketCardinality, buildPipelineTree, doRewrite, getName, 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
getType
-
Field Details
-
Constructor Details
-
ValuesSourceAggregationBuilder
protected ValuesSourceAggregationBuilder(java.lang.String name) -
ValuesSourceAggregationBuilder
protected ValuesSourceAggregationBuilder(ValuesSourceAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metadata) -
ValuesSourceAggregationBuilder
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
declareFields
public static <T> void declareFields(org.elasticsearch.common.xcontent.AbstractObjectParser<? extends ValuesSourceAggregationBuilder<?>,T> objectParser, boolean scriptable, boolean formattable, boolean timezoneAware) -
doWriteTo
- Specified by:
doWriteToin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>>- Throws:
java.io.IOException
-
innerWriteTo
Write subclass's state to the stream.- Throws:
java.io.IOException
-
serializeTargetValueType
DO NOT OVERRIDE THIS! This method only exists for legacy support. No new aggregations need this, nor should they override it.- Parameters:
version- For backwards compatibility, subclasses can change behavior based on the version
-
field
Sets the field to use for this aggregation. -
field
public java.lang.String field()Gets the field to use for this aggregation. -
script
Sets the script to use for this aggregation. -
script
Gets the script to use for this aggregation. -
userValueTypeHint
This setter should only be used during parsing, to set the userValueTypeHint. This is information the user provides in the json query to indicate the output type of a script or the type of the 'missing' replacement value.- Parameters:
valueType- - The parsedValueTypebased on the string the user specified- Returns:
- - The modified builder instance, for chaining.
-
userValueTypeHint
-
format
Sets the format to use for the output of the aggregation. -
format
public java.lang.String format()Gets the format to use for the output of the aggregation. -
missing
Sets the value to use when the aggregation finds a missing value in a document -
missing
public java.lang.Object missing()Gets the value to use when the aggregation finds a missing value in a document -
timeZone
Sets the time zone to use for this aggregation -
timeZone
public java.time.ZoneId timeZone()Gets the time zone to use for this aggregation -
doBuild
protected final ValuesSourceAggregatorFactory doBuild(QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException- Specified by:
doBuildin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>>- Throws:
java.io.IOException
-
defaultValueSourceType
Aggregations 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.- Returns:
- The CoreValuesSourceType we expect this script to yield.
-
resolveConfig
-
innerBuild
protected abstract ValuesSourceAggregatorFactory innerBuild(QueryShardContext queryShardContext, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException- Throws:
java.io.IOException
-
internalXContent
public final org.elasticsearch.common.xcontent.XContentBuilder internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
internalXContentin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>>- Throws:
java.io.IOException
-
doXContentBody
protected abstract org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>>
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<AB>>
-