Class TopMetricsAggregationBuilder
java.lang.Object
org.elasticsearch.search.aggregations.AggregationBuilder
org.elasticsearch.search.aggregations.AbstractAggregationBuilder<TopMetricsAggregationBuilder>
org.elasticsearch.client.analytics.TopMetricsAggregationBuilder
- All Implemented Interfaces:
org.elasticsearch.common.io.stream.NamedWriteable
,org.elasticsearch.common.io.stream.Writeable
,org.elasticsearch.index.query.Rewriteable<org.elasticsearch.search.aggregations.AggregationBuilder>
,org.elasticsearch.search.aggregations.BaseAggregationBuilder
,org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentFragment
public class TopMetricsAggregationBuilder
extends org.elasticsearch.search.aggregations.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
org.elasticsearch.search.aggregations.AggregationBuilder.BucketCardinality, org.elasticsearch.search.aggregations.AggregationBuilder.CommonFields
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
-
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.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionTopMetricsAggregationBuilder
(String name, org.elasticsearch.search.sort.SortBuilder<?> sort, int size, String... metrics) Build the request. -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.search.aggregations.AggregationBuilder.BucketCardinality
protected org.elasticsearch.search.aggregations.AggregatorFactory
doBuild
(org.elasticsearch.search.aggregations.support.AggregationContext context, org.elasticsearch.search.aggregations.AggregatorFactory parent, org.elasticsearch.search.aggregations.AggregatorFactories.Builder subfactoriesBuilder) protected void
doWriteTo
(org.elasticsearch.common.io.stream.StreamOutput out) getType()
protected org.elasticsearch.xcontent.XContentBuilder
internalXContent
(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) protected org.elasticsearch.search.aggregations.AggregationBuilder
shallowCopy
(org.elasticsearch.search.aggregations.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, writeTo
Methods inherited from class org.elasticsearch.search.aggregations.AggregationBuilder
buildPipelineTree, bytesToPreallocate, doRewrite, getName, getOutputFieldNames, getPipelineAggregations, getSubAggregations, rewrite, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
TopMetricsAggregationBuilder
public TopMetricsAggregationBuilder(String name, org.elasticsearch.search.sort.SortBuilder<?> sort, int size, String... metrics) 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:
internalXContent
in classorg.elasticsearch.search.aggregations.AbstractAggregationBuilder<TopMetricsAggregationBuilder>
- Throws:
IOException
-
doWriteTo
- Specified by:
doWriteTo
in classorg.elasticsearch.search.aggregations.AbstractAggregationBuilder<TopMetricsAggregationBuilder>
- Throws:
IOException
-
bucketCardinality
public org.elasticsearch.search.aggregations.AggregationBuilder.BucketCardinality bucketCardinality()- Specified by:
bucketCardinality
in classorg.elasticsearch.search.aggregations.AggregationBuilder
-
doBuild
protected org.elasticsearch.search.aggregations.AggregatorFactory doBuild(org.elasticsearch.search.aggregations.support.AggregationContext context, org.elasticsearch.search.aggregations.AggregatorFactory parent, org.elasticsearch.search.aggregations.AggregatorFactories.Builder subfactoriesBuilder) throws IOException - Specified by:
doBuild
in classorg.elasticsearch.search.aggregations.AbstractAggregationBuilder<TopMetricsAggregationBuilder>
- Throws:
IOException
-
shallowCopy
protected org.elasticsearch.search.aggregations.AggregationBuilder shallowCopy(org.elasticsearch.search.aggregations.AggregatorFactories.Builder factoriesBuilder, Map<String, Object> metadata) - Specified by:
shallowCopy
in classorg.elasticsearch.search.aggregations.AggregationBuilder
-