Skip to content

Commit 77268d7

Browse files
authored
[DOCS] Clarify supported fields for top_metrics agg (#73907) (#73917)
Changes: * Notes `metrics.field` supports `boolean` fields and runtime fields. * Notes `metrics.field` doesn't support array values. Closes #72889
1 parent 5943cd5 commit 77268d7

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

docs/reference/aggregations/metrics/top-metrics-aggregation.asciidoc

+15-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,21 @@ request. So,
7070
==== `metrics`
7171

7272
`metrics` selects the fields of the "top" document to return. You can request
73-
a single metric with something like `"metric": {"field": "m"}` or multiple
74-
metrics by requesting a list of metrics like `"metric": [{"field": "m"}, {"field": "i"}`.
75-
The fields can be <<number,numbers>>, <<keyword,keywords>>, or <<ip,ips>>.
76-
Here is a more complete example:
73+
a single metric with something like `"metrics": {"field": "m"}` or multiple
74+
metrics by requesting a list of metrics like `"metrics": [{"field": "m"}, {"field": "i"}`.
75+
76+
`metrics.field` supports the following field types:
77+
78+
* <<boolean,`boolean`>>
79+
* <<ip,`ip`>>
80+
* <<keyword,keywords>>
81+
* <<number,numbers>>
82+
83+
Except for keywords, <<runtime,runtime fields>> for corresponding types are also
84+
supported. `metrics.field` doesn't support fields with <<array,array values>>. A
85+
`top_metric` aggregation on array values may return inconsistent results.
86+
87+
The following example runs a `top_metrics` aggregation on several field types.
7788

7889
[source,console,id=search-aggregations-metrics-top-metrics-list-of-metrics]
7990
----

0 commit comments

Comments
 (0)