使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

elasticsearch怎么同时对类型的多个字段根据条件进行聚合

Elasticsearch | 作者 lock | 发布于2017年03月20日 | 阅读数:3304

elasticsearch怎么同时对类型的多个字段根据条件进行聚合?
比如
a类型:
[{"name":"zhangsan","age":12},{"name":"zhangsan","age":12},{"name":"lisi","age":13},{"name":"lisi","age":13}]
希望得到的聚类结果如下:
"aggregations" : {
    "name" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [ {
        "key" : "zhangsan",
        "doc_count" : 2
      }, {
        "key" : "lisi",
        "doc_count" : 2
      } ]
    },
"age" : {
      "doc_count_error_upper_bound" : 0,
      "sum_other_doc_count" : 0,
      "buckets" : [ {
        "key" : "12",
        "doc_count" : 2
      }, {
        "key" : "13",
        "doc_count" : 2
      } ]
    }
  }
 
查询语句怎么写
已邀请:

要回复问题请先登录注册