elasticsearch/docs/reference/esql/functions/mv_max.asciidoc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
538 B
Plaintext
Raw Normal View History

[[esql-mv_max]]
=== `MV_MAX`
Converts a multivalued field into a single valued field containing the maximum value. For example:
[source,esql]
----
include::{esql-specs}/math.csv-spec[tag=mv_max]
include::{esql-specs}/math.csv-spec[tag=mv_max-result]
----
It can be used by any field type, including `keyword` fields. In that case picks the
last string, comparing their utf-8 representation byte by byte:
[source,esql]
----
include::{esql-specs}/string.csv-spec[tag=mv_max]
include::{esql-specs}/string.csv-spec[tag=mv_max-result]
----