📜  elasticsearch 聚合唯一值 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:04.835000             🧑  作者: Mango

代码示例1
GET /_search
{
  "size": 0, // don't return any documents, just the aggregation
  "aggs" : {
    "distinctValues" : { // this can be any label you want
      "terms" : {
        "field" : "path.to.field", // field to be aggregated
        "size" : 500 // how many unique values to return
      }
    }
  }
}