diff --git a/app/models/event.rb b/app/models/event.rb index 08d620e50..1a8335cd1 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -231,9 +231,15 @@ def self.query_fields def self.query_aggregations sum_distribution = { sum_bucket: { - buckets_path: "year_months>total_by_year_month" - } + buckets_path: "year_months>total_by_year_month" + } + } + + sum_year_distribution = { + sum_bucket: { + buckets_path: "years>total_by_year" } + } { sources: { terms: { field: 'source_id', size: 50, min_doc_count: 1 } },