您当前的位置: 首页 > 慢生活 > 程序人生 网站首页程序人生
elasticSearch总和聚合
发布时间:2021-09-03 14:30:09编辑:雪饮阅读()
ElasticSearch中总和聚合也就是sum求和。
请求正文:
{
"aggs" : {
"total_fees" : { "sum" : { "field" : "fees" } }
}
}
响应正文:
{
"took": 13,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 5,
"relation": "eq"
},
"max_score": null,
"hits": []
},
"aggregations": {
"total_fees": {
"value": 15504.0
}
}
}
关键字词:elasticSearch,sum,总和聚合