powered by
Define Elasticsearch aggregation.
aggs(json)
JSON object describing the aggregation that needs to be executed.
An elastic_aggs object.
elastic_aggs
https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
# NOT RUN { avg_sepal_width_per_cat <- aggs('{"avg_sepal_width_per_cat": { "terms": {"field": "species"}, "aggs": {"avg_sepal_width": {"avg": {"field": "sepal_width"}}}} }') # }
Run the code above in your browser using DataLab