我正在尝试在Python的sdk中为弹性系统添加一个aggs查询。 Btu我似乎无法使它工作。 E.g
body = {
"query":{
"bool":{
"must_not":{
"term":{
"dst":"-"
}
}
}
},
"aggs":{
"sources":{
"terms":{
"field":'src'
}
}
}
}
执行
>>es.indices.validate_query(index="myindex", body=body)
{u'valid': False, u'_shards': {u'successful': 11, u'failed': 0, u'total': 11}}
在没有'aggs'键的情况下执行相同的操作会正确验证。如何在类似查询的dict中传递聚合以与python库一起使用?