Im using ES 1.4. When I perform an aggregation, the result returns the hits array as well. Is there a way to only return the aggregations?
2 Answers
You would have to specify in the query that the size is equal to 0
ex :
{
"query": ... ,
"aggs": ... ,
"size": 0
}
You can find the related documentation here.
Comments
It is possible. You should type additional Parameter (?search_type=count) in your Url. Have a look here: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-aggregations.html#_returning_only_aggregation_results
1 Comment
Boushley
The new documentation link is here: elastic.co/guide/en/elasticsearch/reference/current/… And it recommends the
"size": 0 approach