With the following index mapping:
{ "index_name": { "mappings": { "object_name": { "dynamic": "strict", "properties": { "nested_field_name": { "type": "nested", "properties": { "some_property": { "type": "keyword" } } } } } } } }
I needed to use this query:
GET /index_name/_search { "query": { "nested": { "path": "nested_field_name", "query": { "bool": { "must": [ { "exists": { "field": "nested_field_name.some_property" } } ] } } } } }
Elastic Version 5.4.3
source share