Search code examples
elasticsearch

Perform Elasticsearch aggregation without returning hits array


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?


Solution

  • 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