Best way to check if a field exist in an Elasticsearch document
You can use the exists filter combined with a bool/must filter like this: { “query”: { “filtered”: { “filter”: { “bool”: { “must”: [ { “exists”: { “field”: “price” } }, … <– your other constraints, if any ] } } } } } DEPRECATED (since ES5) You can also use the missing filter combined … Read more