您可以将
exists过滤器与以下
bool/must过滤器结合使用:
{ "query": { "filtered": { "filter": { "bool": { "must": [ { "exists": { "field": "price" } }, ... <-- your other constraints, if any ] } } } }}不推荐使用(自ES5起)
您也可以将
missing过滤器与
bool/must_not过滤器结合使用:
{ "query": { "filtered": { "filter": { "bool": { "must_not": [ { "missing": { "field": "price" } } ] } } } }}


