Class AvgAggregationBuilder
java.lang.Object
org.opensearch.search.aggregations.AggregationBuilder
org.opensearch.search.aggregations.AbstractAggregationBuilder<AvgAggregationBuilder>
org.opensearch.search.aggregations.support.ValuesSourceAggregationBuilder<AvgAggregationBuilder>
org.opensearch.search.aggregations.support.ValuesSourceAggregationBuilder.LeafOnly<ValuesSource.Numeric,AvgAggregationBuilder>
org.opensearch.search.aggregations.metrics.AvgAggregationBuilder
- All Implemented Interfaces:
org.opensearch.core.common.io.stream.NamedWriteable
,org.opensearch.core.common.io.stream.Writeable
,org.opensearch.core.xcontent.ToXContent
,org.opensearch.core.xcontent.ToXContentFragment
,Rewriteable<AggregationBuilder>
,BaseAggregationBuilder
public class AvgAggregationBuilder
extends ValuesSourceAggregationBuilder.LeafOnly<ValuesSource.Numeric,AvgAggregationBuilder>
Aggregation Builder for avg agg
- Opensearch.internal:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensearch.search.aggregations.support.ValuesSourceAggregationBuilder
ValuesSourceAggregationBuilder.LeafOnly<VS extends ValuesSource,
AB extends ValuesSourceAggregationBuilder<AB>> Nested classes/interfaces inherited from class org.opensearch.search.aggregations.AggregationBuilder
AggregationBuilder.BucketCardinality, AggregationBuilder.CommonFields
Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
org.opensearch.core.common.io.stream.Writeable.Reader<V>, org.opensearch.core.common.io.stream.Writeable.WriteableRegistry, org.opensearch.core.common.io.stream.Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final org.opensearch.core.xcontent.ObjectParser
<AvgAggregationBuilder, String> static final ValuesSourceRegistry.RegistryKey
<MetricAggregatorSupplier> Fields inherited from class org.opensearch.search.aggregations.support.ValuesSourceAggregationBuilder
config
Fields inherited from class org.opensearch.search.aggregations.AbstractAggregationBuilder
metadata
Fields inherited from class org.opensearch.search.aggregations.AggregationBuilder
factoriesBuilder, name
Fields inherited from interface org.opensearch.index.query.Rewriteable
MAX_REWRITE_ROUNDS
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionAvgAggregationBuilder
(String name) AvgAggregationBuilder
(org.opensearch.core.common.io.stream.StreamInput in) Read from a stream.AvgAggregationBuilder
(AvgAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) -
Method Summary
Modifier and TypeMethodDescriptionprotected ValuesSourceType
Aggregations should use this method to define aValuesSourceType
of last resort.org.opensearch.core.xcontent.XContentBuilder
doXContentBody
(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) protected ValuesSourceRegistry.RegistryKey
<?> getType()
The name of the type of aggregation built by this builder.protected org.opensearch.search.aggregations.metrics.AvgAggregatorFactory
innerBuild
(QueryShardContext queryShardContext, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) protected void
innerWriteTo
(org.opensearch.core.common.io.stream.StreamOutput out) Write subclass's state to the stream.static void
protected AggregationBuilder
shallowCopy
(AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) Create a shallow copy of this builder and replacingAggregationBuilder.factoriesBuilder
andmetadata
.Methods inherited from class org.opensearch.search.aggregations.support.ValuesSourceAggregationBuilder.LeafOnly
bucketCardinality, subAggregations
Methods inherited from class org.opensearch.search.aggregations.support.ValuesSourceAggregationBuilder
declareFields, declareFields, doBuild, doWriteTo, equals, field, field, format, format, hashCode, internalXContent, missing, missing, resolveConfig, script, script, serializeTargetValueType, timeZone, timeZone, userValueTypeHint, userValueTypeHint
Methods inherited from class org.opensearch.search.aggregations.AbstractAggregationBuilder
build, getMetadata, getWriteableName, setMetadata, subAggregation, subAggregation, toXContent, writeTo
Methods inherited from class org.opensearch.search.aggregations.AggregationBuilder
buildPipelineTree, doRewrite, getName, getPipelineAggregations, getSubAggregations, rewrite, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opensearch.core.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
REGISTRY_KEY
-
PARSER
-
-
Constructor Details
-
AvgAggregationBuilder
-
AvgAggregationBuilder
public AvgAggregationBuilder(AvgAggregationBuilder clone, AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) -
AvgAggregationBuilder
public AvgAggregationBuilder(org.opensearch.core.common.io.stream.StreamInput in) throws IOException Read from a stream.- Throws:
IOException
-
-
Method Details
-
registerAggregators
-
defaultValueSourceType
Description copied from class:ValuesSourceAggregationBuilder
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.- Specified by:
defaultValueSourceType
in classValuesSourceAggregationBuilder<AvgAggregationBuilder>
- Returns:
- The CoreValuesSourceType we expect this script to yield.
-
shallowCopy
protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) Description copied from class:AggregationBuilder
Create a shallow copy of this builder and replacingAggregationBuilder.factoriesBuilder
andmetadata
. Used byAggregationBuilder.rewrite(QueryRewriteContext)
.- Specified by:
shallowCopy
in classAggregationBuilder
-
innerWriteTo
protected void innerWriteTo(org.opensearch.core.common.io.stream.StreamOutput out) Description copied from class:ValuesSourceAggregationBuilder
Write subclass's state to the stream.- Specified by:
innerWriteTo
in classValuesSourceAggregationBuilder<AvgAggregationBuilder>
-
innerBuild
protected org.opensearch.search.aggregations.metrics.AvgAggregatorFactory innerBuild(QueryShardContext queryShardContext, ValuesSourceConfig config, AggregatorFactory parent, AggregatorFactories.Builder subFactoriesBuilder) throws IOException - Specified by:
innerBuild
in classValuesSourceAggregationBuilder<AvgAggregationBuilder>
- Throws:
IOException
-
doXContentBody
public org.opensearch.core.xcontent.XContentBuilder doXContentBody(org.opensearch.core.xcontent.XContentBuilder builder, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException - Specified by:
doXContentBody
in classValuesSourceAggregationBuilder<AvgAggregationBuilder>
- Throws:
IOException
-
getType
Description copied from interface:BaseAggregationBuilder
The name of the type of aggregation built by this builder. -
getRegistryKey
- Specified by:
getRegistryKey
in classValuesSourceAggregationBuilder<AvgAggregationBuilder>
-