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

33 lines
831 B
Plaintext

[discrete]
[[esql-mv_min]]
=== `MV_MIN`
[.text-center]
image::esql/functions/signature/mv_min.svg[Embedded,opts=inline]
Converts a multivalued field into a single valued field containing the minimum value. For example:
[source.merge.styled,esql]
----
include::{esql-specs}/math.csv-spec[tag=mv_min]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/math.csv-spec[tag=mv_min-result]
|===
It can be used by any field type, including `keyword` fields. In that case picks the
first string, comparing their utf-8 representation byte by byte:
[source.merge.styled,esql]
----
include::{esql-specs}/string.csv-spec[tag=mv_min]
----
[%header.monospaced.styled,format=dsv,separator=|]
|===
include::{esql-specs}/string.csv-spec[tag=mv_min-result]
|===
Supported types:
include::types/mv_min.asciidoc[]