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
Nested ClassesModifier and TypeClassDescriptionstatic classNested 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 inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
metadataFields inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
DEFAULT_PREALLOCATION, factoriesBuilder, nameFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedRead from a stream.protectedMultiValuesSourceAggregationBuilder(MultiValuesSourceAggregationBuilder<AB> clone, AggregatorFactories.Builder factoriesBuilder, Map<String,Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ValuesSourceTypeAggregations should use this method to define aValuesSourceTypeof last resort.protected MultiValuesSourceAggregatorFactorydoBuild(AggregationContext context, 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)booleanprotected ABfield(String propertyName, MultiValuesSourceFieldConfig config)Sets the format to use for the output of the aggregation.inthashCode()protected abstract MultiValuesSourceAggregatorFactoryinnerBuild(AggregationContext context, Map<String,ValuesSourceConfig> configs, Map<String,QueryBuilder> filters, DocValueFormat format, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder)protected abstract voidinnerWriteTo(StreamOutput out)Write subclass' state to the streamorg.elasticsearch.common.xcontent.XContentBuilderinternalXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)static DocValueFormatresolveFormat(String format, ValueType valueType, ValuesSourceType defaultValuesSourceType)userValueTypeHint(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
bucketCardinality, buildPipelineTree, bytesToPreallocate, doRewrite, getName, getOutputFieldNames, 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
getTypeMethods 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:
doWriteToin classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>- Throws:
IOException
-
innerWriteTo
Write subclass' state to the stream- Throws:
IOException
-
field
-
userValueTypeHint
Sets theValueTypefor 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 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.
-
doBuild
protected final MultiValuesSourceAggregatorFactory doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException- Specified by:
doBuildin 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:
internalXContentin 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:
hashCodein classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
-
equals
- Overrides:
equalsin classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>
-