解决方案是通过使lstChildren成为嵌套对象来首先更改映射。然后,使用嵌套查询将确保符合指定的所有条件。下面的嵌套查询指定了两个仅返回预期结果的条件,但是为了简单起见,我对“
IntValue”使用“等于”而不是“大于”:
{ "query": { "nested": { "path": "lstChildren", "query": { "bool": { "must": [ { "match": { "lstChildren.AttributeID":"2" } }, { "match": { "lstChildren.IntValue": "31" } } ] } } } }}


