Class ValuesSourceAggregationBuilder<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>>
- java.lang.Object
-
- org.elasticsearch.search.aggregations.AggregationBuilder
-
- org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
-
- org.elasticsearch.search.aggregations.support.ValuesSourceAggregationBuilder<VS,AB>
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,BaseAggregationBuilder
- Direct Known Subclasses:
AbstractRangeBuilder,AutoDateHistogramAggregationBuilder,DateHistogramAggregationBuilder,DiversifiedAggregationBuilder,GeoBoundsAggregationBuilder,GeoDistanceAggregationBuilder,GeoGridAggregationBuilder,HistogramAggregationBuilder,IpRangeAggregationBuilder,MissingAggregationBuilder,SignificantTermsAggregationBuilder,TermsAggregationBuilder,ValuesSourceAggregationBuilder.LeafOnly
public abstract class ValuesSourceAggregationBuilder<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>> extends AbstractAggregationBuilder<AB>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends ValuesSourceAggregationBuilder<VS,AB>>-
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
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 ValuesSourceConfig<VS>config-
Fields inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
metaData
-
Fields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
factoriesBuilder, name
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedValuesSourceAggregationBuilder(java.lang.String name, ValuesSourceType valuesSourceType, ValueType targetValueType)protectedValuesSourceAggregationBuilder(StreamInput in, ValuesSourceType valuesSourceType)Read an aggregation from a stream that serializes its targetValueType.protectedValuesSourceAggregationBuilder(StreamInput in, ValuesSourceType valuesSourceType, ValueType targetValueType)Read an aggregation from a stream that does not serialize its targetValueType.protectedValuesSourceAggregationBuilder(ValuesSourceAggregationBuilder<VS,AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
-
Method Summary
Modifier and Type Method Description protected ValuesSourceAggregatorFactory<VS,?>doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder)protected booleandoEquals(java.lang.Object obj)protected intdoHashCode()protected voiddoWriteTo(StreamOutput out)protected abstract XContentBuilderdoXContentBody(XContentBuilder builder, ToXContent.Params params)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.protected abstract ValuesSourceAggregatorFactory<VS,?>innerBuild(SearchContext context, ValuesSourceConfig<VS> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder)protected abstract booleaninnerEquals(java.lang.Object obj)protected abstract intinnerHashCode()protected abstract voidinnerWriteTo(StreamOutput out)Write subclass's state to the stream.XContentBuilderinternalXContent(XContentBuilder builder, 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 ValuesSourceConfig<VS>resolveConfig(SearchContext context)Scriptscript()Gets the script to use for this aggregation.ABscript(Script script)Sets the script to use for this aggregation.protected booleanserializeTargetValueType()Should this builder serialize its targetValueType? Defaults to false.java.time.ZoneIdtimeZone()Gets the time zone to use for this aggregationABtimeZone(java.time.ZoneId timeZone)Sets the time zone to use for this aggregationValueTypevalueType()Gets theValueTypefor the value produced by this aggregationABvalueType(ValueType valueType)Sets theValueTypefor the value produced by this aggregation-
Methods inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
build, equals, getMetaData, getWriteableName, hashCode, setMetaData, subAggregation, subAggregation, subAggregations, toXContent, writeTo
-
Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
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
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
config
protected ValuesSourceConfig<VS extends ValuesSource> config
-
-
Constructor Detail
-
ValuesSourceAggregationBuilder
protected ValuesSourceAggregationBuilder(java.lang.String name, ValuesSourceType valuesSourceType, ValueType targetValueType)
-
ValuesSourceAggregationBuilder
protected ValuesSourceAggregationBuilder(ValuesSourceAggregationBuilder<VS,AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData)
-
ValuesSourceAggregationBuilder
protected ValuesSourceAggregationBuilder(StreamInput in, ValuesSourceType valuesSourceType, ValueType targetValueType) throws java.io.IOException
Read an aggregation from a stream that does not serialize its targetValueType. This should be used by most subclasses.- Throws:
java.io.IOException
-
ValuesSourceAggregationBuilder
protected ValuesSourceAggregationBuilder(StreamInput in, ValuesSourceType valuesSourceType) throws java.io.IOException
Read an aggregation from a stream that serializes its targetValueType. This should only be used by subclasses that overrideserializeTargetValueType()to return true.- Throws:
java.io.IOException
-
-
Method Detail
-
doWriteTo
protected final void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteToin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<VS,AB>>- Throws:
java.io.IOException
-
innerWriteTo
protected abstract void innerWriteTo(StreamOutput out) throws java.io.IOException
Write subclass's state to the stream.- Throws:
java.io.IOException
-
serializeTargetValueType
protected boolean serializeTargetValueType()
Should this builder serialize its targetValueType? Defaults to false. All subclasses that override this to true should use the three argument read constructor rather than the four argument version.
-
field
public AB field(java.lang.String field)
Sets the field to use for this aggregation.
-
field
public java.lang.String field()
Gets the field to use for this aggregation.
-
script
public Script script()
Gets the script to use for this aggregation.
-
valueType
public AB valueType(ValueType valueType)
Sets theValueTypefor the value produced by this aggregation
-
valueType
public ValueType valueType()
Gets theValueTypefor the value produced by this aggregation
-
format
public AB format(java.lang.String 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
public AB missing(java.lang.Object 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
public AB timeZone(java.time.ZoneId 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<VS,?> doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
- Specified by:
doBuildin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<VS,AB>>- Throws:
java.io.IOException
-
resolveConfig
protected ValuesSourceConfig<VS> resolveConfig(SearchContext context)
-
innerBuild
protected abstract ValuesSourceAggregatorFactory<VS,?> innerBuild(SearchContext context, ValuesSourceConfig<VS> config, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
- Throws:
java.io.IOException
-
internalXContent
public final XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
internalXContentin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<VS,AB>>- Throws:
java.io.IOException
-
doXContentBody
protected abstract XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Throws:
java.io.IOException
-
doHashCode
protected final int doHashCode()
- Specified by:
doHashCodein classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<VS,AB>>
-
innerHashCode
protected abstract int innerHashCode()
-
doEquals
protected final boolean doEquals(java.lang.Object obj)
- Specified by:
doEqualsin classAbstractAggregationBuilder<AB extends ValuesSourceAggregationBuilder<VS,AB>>
-
innerEquals
protected abstract boolean innerEquals(java.lang.Object obj)
-
-