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 toValuesSourceAggregationBuilder
, 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 class
MultiValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,AB extends MultiValuesSourceAggregationBuilder<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 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 protected
MultiValuesSourceAggregationBuilder(java.lang.String name, ValueType targetValueType)
protected
MultiValuesSourceAggregationBuilder(StreamInput in, ValueType targetValueType)
protected
MultiValuesSourceAggregationBuilder(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(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder)
protected boolean
doEquals(java.lang.Object other)
protected int
doHashCode()
protected void
doWriteTo(StreamOutput out)
protected abstract XContentBuilder
doXContentBody(XContentBuilder builder, ToXContent.Params params)
protected AB
field(java.lang.String propertyName, MultiValuesSourceFieldConfig config)
java.util.Map<java.lang.String,MultiValuesSourceFieldConfig>
fields()
java.lang.String
format()
Gets the format to use for the output of the aggregation.AB
format(java.lang.String format)
Sets the format to use for the output of the aggregation.protected abstract MultiValuesSourceAggregatorFactory<VS,?>
innerBuild(SearchContext context, java.util.Map<java.lang.String,ValuesSourceConfig<VS>> configs, DocValueFormat format, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder)
protected abstract boolean
innerEquals(java.lang.Object obj)
protected abstract int
innerHashCode()
protected abstract void
innerWriteTo(StreamOutput out)
Write subclass' state to the streamXContentBuilder
internalXContent(XContentBuilder builder, ToXContent.Params params)
protected boolean
serializeTargetValueType()
Should this builder serialize its targetValueType? Defaults to false.ValueType
valueType()
Gets theValueType
for the value produced by this aggregationAB
valueType(ValueType valueType)
Sets theValueType
for 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
-
-
-
-
Constructor Detail
-
MultiValuesSourceAggregationBuilder
protected MultiValuesSourceAggregationBuilder(java.lang.String name, ValueType targetValueType)
-
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 Detail
-
doWriteTo
protected final void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteTo
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>
- Throws:
java.io.IOException
-
innerWriteTo
protected abstract void innerWriteTo(StreamOutput out) throws java.io.IOException
Write subclass' state to the stream- Throws:
java.io.IOException
-
field
protected AB field(java.lang.String propertyName, MultiValuesSourceFieldConfig config)
-
fields
public java.util.Map<java.lang.String,MultiValuesSourceFieldConfig> fields()
-
valueType
public AB valueType(ValueType valueType)
Sets theValueType
for the value produced by this aggregation
-
valueType
public ValueType valueType()
Gets theValueType
for 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.
-
doBuild
protected final MultiValuesSourceAggregatorFactory<VS,?> doBuild(SearchContext context, AggregatorFactory<?> parent, AggregatorFactories.Builder subFactoriesBuilder) throws java.io.IOException
- Specified by:
doBuild
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>
- Throws:
java.io.IOException
-
innerBuild
protected abstract MultiValuesSourceAggregatorFactory<VS,?> innerBuild(SearchContext context, 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:
internalXContent
in 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
-
doHashCode
protected final int doHashCode()
- Specified by:
doHashCode
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>
-
innerHashCode
protected abstract int innerHashCode()
-
doEquals
protected final boolean doEquals(java.lang.Object other)
- Specified by:
doEquals
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<VS,AB>>
-
innerEquals
protected abstract boolean innerEquals(java.lang.Object obj)
-
-