Class TopMetricsAggregationBuilder
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<TopMetricsAggregationBuilder>
org.elasticsearch.client.analytics.TopMetricsAggregationBuilder
- All Implemented Interfaces:
NamedWriteable,Writeable,Rewriteable<AggregationBuilder>,BaseAggregationBuilder,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentFragment
public class TopMetricsAggregationBuilder
extends AbstractAggregationBuilder<TopMetricsAggregationBuilder>
Builds the Top Metrics aggregation request.
NOTE: This extends AbstractAggregationBuilder for compatibility
with SearchSourceBuilder.aggregation(AggregationBuilder) but it
doesn't support any "server" side things like
Writeable.writeTo(StreamOutput),
AggregationBuilder.rewrite(QueryRewriteContext), or
AbstractAggregationBuilder.build(AggregationContext, AggregatorFactory).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
AggregationBuilder.BucketCardinality, AggregationBuilder.CommonFieldsNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V extends Object>, Writeable.Writer<V extends Object> -
Field Summary
FieldsFields 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_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTopMetricsAggregationBuilder(String name, SortBuilder<?> sort, int size, String... metrics) Build the request. -
Method Summary
Modifier and TypeMethodDescriptionprotected AggregatorFactorydoBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder) protected voiddoWriteTo(StreamOutput out) getType()protected org.elasticsearch.xcontent.XContentBuilderinternalXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) protected AggregationBuildershallowCopy(AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) Methods inherited from class org.elasticsearch.search.aggregations.AbstractAggregationBuilder
build, equals, getMetadata, getWriteableName, hashCode, setMetadata, subAggregation, subAggregation, subAggregations, toXContent, writeToMethods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
buildPipelineTree, bytesToPreallocate, doRewrite, getName, getOutputFieldNames, getPipelineAggregations, getSubAggregations, isInSortOrderExecutionRequired, rewrite, toString, validateSequentiallyOrdered, validateSequentiallyOrderedWithoutGapsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
TopMetricsAggregationBuilder
Build the request.- Parameters:
name- the name of the metricsort- the sort key used to select the top metricssize- number of results to return per bucketmetrics- the names of the fields to select
-
-
Method Details
-
getType
-
internalXContent
protected org.elasticsearch.xcontent.XContentBuilder internalXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
internalXContentin classAbstractAggregationBuilder<TopMetricsAggregationBuilder>- Throws:
IOException
-
doWriteTo
- Specified by:
doWriteToin classAbstractAggregationBuilder<TopMetricsAggregationBuilder>- Throws:
IOException
-
bucketCardinality
- Specified by:
bucketCardinalityin classAggregationBuilder
-
doBuild
protected AggregatorFactory doBuild(AggregationContext context, AggregatorFactory parent, AggregatorFactories.Builder subfactoriesBuilder) throws IOException - Specified by:
doBuildin classAbstractAggregationBuilder<TopMetricsAggregationBuilder>- Throws:
IOException
-
shallowCopy
protected AggregationBuilder shallowCopy(AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) - Specified by:
shallowCopyin classAggregationBuilder
-