Loading

ES|QL MV_COUNT function

Embedded
field

Expression that can be null, a single value, or multiple values.

Converts a multivalued expression into a single valued column containing a count of the number of values.

field result
boolean integer
cartesian_point integer
cartesian_shape integer
date integer
date_nanos integer
double integer
geo_point integer
geo_shape integer
geohash integer
geohex integer
geotile integer
integer integer
ip integer
keyword integer
long integer
text integer
unsigned_long integer
version integer
ROW a=["foo", "zoo", "bar"]
| EVAL count_a = MV_COUNT(a)
		
a:keyword count_a:integer
["foo", "zoo", "bar"] 3