diff --git a/app/controllers/concerns/facetable.rb b/app/controllers/concerns/facetable.rb index 95c66dd59..ce79659c4 100644 --- a/app/controllers/concerns/facetable.rb +++ b/app/controllers/concerns/facetable.rb @@ -323,14 +323,7 @@ def providers_totals(arr) { "id" => hsh["key"], "title" => providers[hsh["key"].upcase], "count" => hsh["doc_count"], - "year" => facet_annual(hsh.year.buckets), - "states" => facet_by_key(hsh.states.buckets) - - # "this_month" => facet_anual(hsh.this_month.buckets), - # "this_year" => facet_anual(hsh.this_year.buckets), - # "last_year" => facet_anual(hsh.last_year.buckets)}, - # "two_years_ago" => facet_anual(hsh.two_years_ago.buckets), - # "states" => facet_by_key(hsh.states.buckets) + "year" => facet_annual(hsh.year.buckets) } end end @@ -340,15 +333,7 @@ def prefixes_totals(arr) { "id" => hsh["key"], "title" => hsh["key"], "count" => hsh["doc_count"], - "year" => facet_annual(hsh.year.buckets), - "states" => facet_by_key(hsh.states.buckets) - - # "temporal" => { - # "this_month" => facet_anual(hsh.this_month.buckets), - # "this_year" => facet_anual(hsh.this_year.buckets), - # "last_year" => facet_anual(hsh.last_year.buckets) - # }, - #"states" => facet_by_key(hsh.states.buckets) + "year" => facet_annual(hsh.year.buckets) } end end @@ -363,16 +348,7 @@ def clients_totals(arr) { "id" => hsh["key"], "title" => clients[hsh["key"].upcase], "count" => hsh["doc_count"], - "year" => facet_annual(hsh.year.buckets), - "states" => facet_by_key(hsh.states.buckets) - - # "temporal" => { - # "this_month" => facet_anual(hsh.this_month.buckets), - # "this_year" => facet_anual(hsh.this_year.buckets), - # "last_year" => facet_anual(hsh.last_year.buckets), - # "two_years_ago" => facet_anual(hsh.two_years_ago.buckets) - # }, - # "states" => facet_by_key(hsh.states.buckets) + "year" => facet_annual(hsh.year.buckets) } end end diff --git a/app/models/doi.rb b/app/models/doi.rb index 760036819..3b1d0fb43 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -522,18 +522,7 @@ def self.totals_aggregations end def self.sub_aggregations - { - states: { terms: { field: 'aasm_state', size: 4, min_doc_count: 1 } }, - year: { date_histogram: { field: "created", interval: "year", format: "yyyy" } } - } - - # { - # states: { terms: { field: 'aasm_state', size: 4, min_doc_count: 1 } }, - # this_month: { date_range: { field: 'created', ranges: { from: "now/M", to: "now/d" } } }, - # this_year: { date_range: { field: 'created', ranges: { from: "now/y", to: "now/d" } } }, - # last_year: { date_range: { field: 'created', ranges: { from: "now-1y/y", to: "now/y-1d" } } }, - # two_years_ago: { date_range: { field: 'created', ranges: { from: "now-2y/y", to: "now-1y/y-1d" } } } - # } + { year: { date_histogram: { field: "created", interval: "year", format: "yyyy" } } } end def self.query_fields