Loading

ES|QL SAMPLE function

Embedded
field
The field to collect sample values for.
limit

The maximum number of values to collect.

Collects sample values for a field.

field limit result
boolean integer boolean
cartesian_point integer cartesian_point
cartesian_shape integer cartesian_shape
date integer date
date_nanos integer date_nanos
double integer double
geo_point integer geo_point
geo_shape integer geo_shape
geohash integer geohash
geohex integer geohex
geotile integer geotile
integer integer integer
ip integer ip
keyword integer keyword
long integer long
text integer keyword
unsigned_long integer unsigned_long
version integer version
FROM employees
| STATS sample = SAMPLE(gender, 5)
		
sample:keyword
[F, M, M, F, M]