Skip to content

[7.13] [DOCS] Clarify supported fields for top_metrics agg (#73907) #73917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,21 @@ request. So,
==== `metrics`

`metrics` selects the fields of the "top" document to return. You can request
a single metric with something like `"metric": {"field": "m"}` or multiple
metrics by requesting a list of metrics like `"metric": [{"field": "m"}, {"field": "i"}`.
The fields can be <<number,numbers>>, <<keyword,keywords>>, or <<ip,ips>>.
Here is a more complete example:
a single metric with something like `"metrics": {"field": "m"}` or multiple
metrics by requesting a list of metrics like `"metrics": [{"field": "m"}, {"field": "i"}`.

`metrics.field` supports the following field types:

* <<boolean,`boolean`>>
* <<ip,`ip`>>
* <<keyword,keywords>>
* <<number,numbers>>

Except for keywords, <<runtime,runtime fields>> for corresponding types are also
supported. `metrics.field` doesn't support fields with <<array,array values>>. A
`top_metric` aggregation on array values may return inconsistent results.

The following example runs a `top_metrics` aggregation on several field types.

[source,console,id=search-aggregations-metrics-top-metrics-list-of-metrics]
----
Expand Down