Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

elasticsearch aggregation unique values

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
      }
    }
  }
}
Source by www.elastic.co #
 
PREVIOUS NEXT
Tagged: #elasticsearch #aggregation #unique #values
ADD COMMENT
Topic
Name
8+7 =