Class MultiValuesSourceAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<AB>
org.elasticsearch.search.aggregations.support.MultiValuesSourceAggregationBuilder<AB>
- All Implemented Interfaces:
NamedWriteable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
,Rewriteable<AggregationBuilder>
,BaseAggregationBuilder
- Direct Known Subclasses:
MultiValuesSourceAggregationBuilder.LeafOnly
public abstract class MultiValuesSourceAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<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
Modifier and TypeClassDescriptionstatic class
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
AggregationBuilder.BucketCardinality, AggregationBuilder.CommonFields
Nested 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.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
DEFAULT_PREALLOCATION, factoriesBuilder, name
Fields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionprotected
protected
Read from a stream.protected
MultiValuesSourceAggregationBuilder(MultiValuesSourceAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata)
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ValuesSourceType
Aggregations should use this method to define aValuesSourceType
of last resort.protected MultiValuesSourceAggregatorFactory
doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)
protected void
doWriteTo(StreamOutput out)
protected abstract org.elasticsearch.common.xcontent.XContentBuilder
doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
boolean
protected AB
field(String propertyName, MultiValuesSourceFieldConfig config)
Sets the format to use for the output of the aggregation.int
hashCode()
protected abstract MultiValuesSourceAggregatorFactory
innerBuild(AggregationContext context, Map<String,ValuesSourceConfig> configs, Map<String,QueryBuilder> filters, DocValueFormat format, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)
protected abstract void
innerWriteTo(StreamOutput out)
Write subclass' state to the streamorg.elasticsearch.common.xcontent.XContentBuilder
internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
static DocValueFormat
resolveFormat(String format, ValueType valueType, ValuesSourceType defaultValuesSourceType)
userValueTypeHint(ValueType valueType)
Sets theValueType
for the value produced by this aggregationMethods inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
build, getMetadata, getWriteableName, setMetadata, subAggregation, subAggregation, subAggregations, toXContent, writeTo
Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
bucketCardinality, buildPipelineTree, bytesToPreallocate, doRewrite, getName, getOutputFieldNames, 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 Details
-
MultiValuesSourceAggregationBuilder
-
MultiValuesSourceAggregationBuilder
protected MultiValuesSourceAggregationBuilder(MultiValuesSourceAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata) -
MultiValuesSourceAggregationBuilder
Read from a stream.- Throws:
IOException
-
-
Method Details
-
doWriteTo
- Specified by:
doWriteTo
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
- Throws:
IOException
-
innerWriteTo
Write subclass' state to the stream- Throws:
IOException
-
field
-
userValueTypeHint
Sets theValueType
for the value produced by this aggregation -
format
Sets the format to use for the output of the aggregation. -
defaultValueSourceType
Aggregations should use this method to define aValuesSourceType
of 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.
-
doBuild
protected final MultiValuesSourceAggregatorFactory doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException- Specified by:
doBuild
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
- Throws:
IOException
-
resolveFormat
public static DocValueFormat resolveFormat(@Nullable String format, @Nullable ValueType valueType, ValuesSourceType defaultValuesSourceType) -
innerBuild
protected abstract MultiValuesSourceAggregatorFactory innerBuild(AggregationContext context, Map<String,ValuesSourceConfig> configs, Map<String,QueryBuilder> filters, DocValueFormat format, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException- Throws:
IOException
-
internalXContent
public final org.elasticsearch.common.xcontent.XContentBuilder internalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
internalXContent
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
- Throws:
IOException
-
doXContentBody
protected abstract org.elasticsearch.common.xcontent.XContentBuilder doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Throws:
IOException
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
-
equals
- Overrides:
equals
in classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
-