Exists query #
Returns documents that contain an indexed value for a specific field.
A document matches when the field has at least one non-null value — an empty string or an empty array does not count as existing.
Inside a
nestedquery: supported — matches elements that carry the field.
Examples #
POST /my-collection/_search
{
"query": {
"exists": {
"field": "user"
}
}
}
Parameters for exists
#
field
(Required, string) Field you wish to check for presence.