您需要像下面这样设置
arr字段的类型
nested:
{ "your_type": { "properties": { "arr": { "type": "nested", "properties": { "f1": {"type":"string"}, "f2": {"type":"boolean"} } } } }}然后,您需要使用
nested查询:
{ "nested" : { "path" : "arr", "query" : { "bool" : { "must" : [ { "term" : {"arr.f1" : "a"} }, { "term" : {"arr.f2" : true} } ] } } }}您的
exists过滤器需要指定完整的字段路径
"filter" : { "nested" : {"path" : "arr", "filter" : {"exists" : { "field" : "arr.f1" } }}}


