Class MultiValuesSourceAggregationBuilder<VS extends ValuesSource,AB extends MultiValuesSourceAggregationBuilder<VS,AB>>
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
org.elasticsearch.search.aggregations.support.MultiValuesSourceAggregationBuilder<VS,AB>
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment,BaseAggregationBuilder
- Direct Known Subclasses:
MultiValuesSourceAggregationBuilder.LeafOnly
public abstract class MultiValuesSourceAggregationBuilder<VS extends ValuesSource,AB extends MultiValuesSourceAggregationBuilder<VS,AB>> extends AbstractAggregationBuilder<AB>
Similar to
ValuesSourceAggregationBuilder, except it references multiple ValuesSources (e.g. so that an aggregation
can pull values from multiple fields).
A limitation of this class is that all the ValuesSource's being refereenced must be of the same type.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMultiValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends MultiValuesSourceAggregationBuilder<VS,AB>>Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
AggregationBuilder.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.common.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
Fields 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 protectedMultiValuesSourceAggregationBuilder(java.lang.String name, ValueType targetValueType)protectedMultiValuesSourceAggregationBuilder(StreamInput in, ValueType targetValueType)protectedMultiValuesSourceAggregationBuilder(MultiValuesSourceAggregationBuilder<VS,AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData) -
Method Summary
Modifier and Type Method Description protected MultiValuesSourceAggregatorFactory<VS>doBuild(QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)protected voiddoWriteTo(StreamOutput out)protected abstract XContentBuilderdoXContentBody(XContentBuilder builder, ToXContent.Params params)booleanequals(java.lang.Object obj)protected ABfield(java.lang.String propertyName, MultiValuesSourceFieldConfig config)ABformat(java.lang.String format)Sets the format to use for the output of the aggregation.inthashCode()protected abstract MultiValuesSourceAggregatorFactory<VS>innerBuild(QueryShardContext queryShardContext, java.util.Map<java.lang.String,ValuesSourceConfig<VS>> configs, DocValueFormat format, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)protected abstract voidinnerWriteTo(StreamOutput out)Write subclass' state to the streamXContentBuilderinternalXContent(XContentBuilder builder, ToXContent.Params params)protected booleanserializeTargetValueType()Should this builder serialize its targetValueType? Defaults to false.ABvalueType(ValueType valueType)Sets theValueTypefor the value produced by this aggregationMethods 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
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
-
Constructor Details
-
MultiValuesSourceAggregationBuilder
-
MultiValuesSourceAggregationBuilder
protected MultiValuesSourceAggregationBuilder(MultiValuesSourceAggregationBuilder<VS,AB> clone, AggregatorFactories.Builder factoriesBuilder, java.util.Map<java.lang.String,java.lang.Object> metaData) -
MultiValuesSourceAggregationBuilder
protected MultiValuesSourceAggregationBuilder(StreamInput in, ValueType targetValueType) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteToin classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>- Throws:
java.io.IOException
-
innerWriteTo
Write subclass' state to the stream- Throws:
java.io.IOException
-
field
-
valueType
Sets theValueTypefor the value produced by this aggregation -
format
Sets the format to use for the output of the aggregation. -
doBuild
protected final MultiValuesSourceAggregatorFactory<VS> doBuild(QueryShardContext queryShardContext, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException- Specified by:
doBuildin classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>- Throws:
java.io.IOException
-
innerBuild
protected abstract MultiValuesSourceAggregatorFactory<VS> innerBuild(QueryShardContext queryShardContext, java.util.Map<java.lang.String,ValuesSourceConfig<VS>> configs, DocValueFormat format, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException- 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. -
internalXContent
public final XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
internalXContentin classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>- Throws:
java.io.IOException
-
doXContentBody
protected abstract XContentBuilder doXContentBody(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>
-
equals
public boolean equals(java.lang.Object obj)- Overrides:
equalsin classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>
-