How to get all possible values for field
author?
curl -XGET http://localhost:9200/articles/_search?pretty -d '
{
"aggs" : {
"whatever_you_like_here" : {
"terms" : { "field" : "author", "size":10000 }
}
},
"size" : 0
}'
Note
-
"size":10000Get at most 10000 unique values. Default is 10. -
"size":0By default,"hits"contains 10 documents. We don’t need them. -
By default, the buckets are ordered by the
doc_countin decreasing order.
Reference: bucket terms aggregation
Also note, according to this page, facets have been replaced by aggregations in Elasticsearch 1.0, which are a superset of facets.