我有一个agg查询,它将存储在桶中的文档与相同的电子邮件结合在一起。我正在尝试实现一个计数器,该计数器按存储桶的ID递增-但每个存储桶中的记录应具有相同的ID。我已经看到了更新API文档,但是没有解决存储桶更新。
https://www.elastic.co/guide/en/elasticsearch/reference/7.2/docs-update-by-query.html
请参阅下面的查询
POST /my_index/_search?
{
"size": 0,
"aggs": {
"GroupByType": {
"terms": {
"field": "Email.keyword",
"size": 15
},
"aggs": {
"Group": {
"top_hits": {
"size": 2,
"_source": {
"includes": [
"Email",
"CustomerNo",
"FirstName",
"LastName",
"Phone"
]
},
"sort": [
{
"CustomerNo.keyword": {
"order": "asc"
}
}
]
}
}
}
}
}
}