【发布时间】:2020-07-26 06:00:13
【问题描述】:
我想在布尔字段中获取聚合,但是输出是错误的:
查询:
""" {
"size": 0,
"aggs": {
"RecentCreated": {
"terms": {
"field": "created_at.keyword",
"order": {
"_key": "desc"
},
"size": 1
},
"aggs": {
"nestedData": {
"nested": {
"path": "data.add.serv"
},
"aggs": {
"NAME": {
"terms": {
"field": "data.add.serv.beast"
, "include": true
}
}
}
}
}
}
}
}
"""
错误:
"type" : "x_content_parse_exception", "reason" : "[terms] include 不支持以下类型的值:VALUE_BOOLEAN"
我一直在阅读,可以通过脚本将真值转换为1来获取聚合中的计数,但是我无法得到真值的结果 如何获得具有真值的布尔字段的计数?
【问题讨论】:
标签: elasticsearch