1GET /_search
2{
3 "size": 0, // don't return any documents, just the aggregation
4 "aggs" : {
5 "distinctValues" : { // this can be any label you want
6 "terms" : {
7 "field" : "path.to.field", // field to be aggregated
8 "size" : 500 // how many unique values to return
9 }
10 }
11 }
12}