class Elasticsearch::DSL::Search::Aggregations::StatsBucket

A sibling pipeline aggregation which calculates a variety of stats across all bucket of a specified metric in a sibling aggregation.

@example Passing the options as a Hash

aggregation :stats_monthly_sales do
  stats_bucket buckets_path: 'sales_per_month>sales'
end

@example Passing the options as a block

aggregation :stats_monthly_sales do
  stats_bucket do
    buckets_path 'sales_per_month>sales'
  end
end

@see www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-pipeline-stats-bucket-aggregation.html