Skip to content

Commit

Permalink
don't show states. datacite/datacite#359
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Nov 22, 2019
1 parent 0ca02f5 commit 598f3e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
30 changes: 3 additions & 27 deletions app/controllers/concerns/facetable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
13 changes: 1 addition & 12 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 598f3e6

Please sign in to comment.