我有同样的问题,按日期计算不同的值,也就是这里提到的同一个问题:http://elasticsearch-users.115913.n3.nabble.com/Count-distinct-value-by-date-td4036320.html这个问题是一年前发布的。有什么新的更新吗?谢谢。
发布于 2014-07-15 17:12:49
在ElasticSearch中没有“不同”的概念,但是通过使用嵌套的集合体,您可以完成相同的任务:
{
"query": {
"match_all": {}
},
"aggs": {
"dt": {
"date_histogram": {
"field": "datetime",
"interval": "day"
},
"aggs": {
"id": {
"terms": {
"field": "unique_identifier"
}
}
}
}
}
}https://stackoverflow.com/questions/24752686
复制相似问题