Skip to content

Commit

Permalink
enable aggregations for prefixes, providers, repos
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Jan 22, 2020
1 parent f0a1e88 commit 22c6d3c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,16 @@ def self.query(query, options={})
options[:page][:number] ||= 1
options[:page][:size] ||= 25

if options[:totals_agg] == "provider"
aggregations = provider_aggregations
elsif options[:totals_agg] == "client"
aggregations = client_aggregations
elsif options[:totals_agg] == "prefix"
aggregations = prefix_aggregations
else
aggregations = get_aggregations_hash(options)
end

# Cursor nav use the search after, this should always be an array of values that match the sort.
if options.dig(:page, :cursor)
from = 0
Expand Down

0 comments on commit 22c6d3c

Please sign in to comment.