Module org.elasticsearch.server
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,VersionedNamedWriteable,Writeable,Rewriteable<AggregationBuilder>,BaseAggregationBuilder,ToXContent,ToXContentFragment
- 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.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
DEFAULT_PREALLOCATION, factoriesBuilder, nameFields inherited from interface org.elasticsearch.index.query.Rewriteable
MAX_REWRITE_ROUNDSFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, 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 final MultiValuesSourceAggregatorFactorydoBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) protected final voiddoWriteTo(StreamOutput out) protected abstract XContentBuilderdoXContentBody(XContentBuilder builder, 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 streamfinal XContentBuilderinternalXContent(XContentBuilder builder, 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, deepCopy, doRewrite, getName, getOutputFieldNames, getPipelineAggregations, getQuery, getSubAggregations, isInSortOrderExecutionRequired, rewrite, shallowCopy, supportsParallelCollection, supportsSampling, toString, validateSequentiallyOrdered, validateSequentiallyOrderedWithoutGapsMethods 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.xcontent.ToXContentFragment
isFragmentMethods inherited from interface org.elasticsearch.common.io.stream.VersionedNamedWriteable
getMinimalSupportedVersion
-
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, throws IOExceptionQueryBuilder> filters, DocValueFormat format, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) - Throws:
IOException
-
internalXContent
public final XContentBuilder internalXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
internalXContentin classAbstractAggregationBuilder<AB extends MultiValuesSourceAggregationBuilder<AB>>- Throws:
IOException
-
doXContentBody
protected abstract XContentBuilder doXContentBody(XContentBuilder builder, 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>>
-