From f260c48ca80d4afc857c00e759fe38732d7808bc Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 14 Oct 2018 10:10:10 -0400 Subject: [PATCH] show registration date in doi aggregations --- app/controllers/dois_controller.rb | 2 ++ app/models/doi.rb | 1 + 2 files changed, 3 insertions(+) diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index b5d3254fa..4f1f59f2a 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -123,6 +123,7 @@ def index resource_types = total > 0 ? facet_by_resource_type(response.response.aggregations.resource_types.buckets) : nil years = total > 0 ? facet_by_year(response.response.aggregations.years.buckets) : nil created = total > 0 ? facet_by_year(response.response.aggregations.created.buckets) : nil + registered = total > 0 ? facet_by_year(response.response.aggregations.registered.buckets) : nil providers = total > 0 ? facet_by_provider(response.response.aggregations.providers.buckets) : nil clients = total > 0 ? facet_by_client(response.response.aggregations.clients.buckets) : nil prefixes = total > 0 ? facet_by_key(response.response.aggregations.prefixes.buckets) : nil @@ -140,6 +141,7 @@ def index resource_types: resource_types, years: years, created: created, + registered: registered, providers: providers, clients: clients, prefixes: prefixes, diff --git a/app/models/doi.rb b/app/models/doi.rb index 419666add..419f48bec 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -204,6 +204,7 @@ def self.query_aggregations states: { terms: { field: 'aasm_state', size: 10, min_doc_count: 1 } }, years: { date_histogram: { field: 'published', interval: 'year', min_doc_count: 1 } }, created: { date_histogram: { field: 'created', interval: 'year', min_doc_count: 1 } }, + registered: { date_histogram: { field: 'registered', interval: 'year', min_doc_count: 1 } }, providers: { terms: { field: 'provider_id', size: 10, min_doc_count: 1 } }, clients: { terms: { field: 'client_id', size: 10, min_doc_count: 1 } }, prefixes: { terms: { field: 'prefix', size: 10, min_doc_count: 1 } },