Elasticsearch直方图聚合

问题描述

@H_404_0@在Elasticsearch的文档中认为这行不通吗,我错了吗?
功能将简化我的很多工作。

@H_404_0@参考:https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html
ES版本:7.9.1。
机器:Ubuntu 18.04

PUT metrics_index/_doc/1
{
  "network.name" : "net-1","latency_histo" : {
      "values" : [1,3,8,12,15],"counts" : [3,7,23,6]
   }
}

PUT metrics_index/_doc/2
{
  "network.name" : "net-2",6,14],"counts" : [8,17,6]
   }
}

POST /metrics_index/_search?size=0
{
  "aggs": {
    "latency_buckets": {
      "histogram": {
        "field": "latency_histo","interval": 5
      }
    }
  }
}
@H_404_0@这将返回:

{
  "took": 2,"timed_out": false,"_shards": {
    "total": 1,"successful": 1,"skipped": 0,"Failed": 0
  },"hits": {
    "total": {
      "value": 2,"relation": "eq"
    },"max_score": null,"hits": []
  },"aggregations": {
    "latency_buckets": {
      "buckets": []
    }
  }
}
@H_404_0@可以请您确认吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)