Skip to content

Commit

Permalink
remove limits on find_by
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Feb 12, 2019
1 parent 5373313 commit 5684477
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/concerns/facetable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ def clients_totals(arr)
# generate hash with id and name for each provider in facet

ids = arr.map { |hsh| hsh["key"] }.join(",")
clients = Client.find_by_ids(ids).results.reduce({}) do |sum, p|
clients = Client.find_by_ids(ids, size: 2000).results.reduce({}) do |sum, p|
puts sum
sum[p.symbol.downcase] = p.name
sum
end
Expand All @@ -170,7 +171,7 @@ def clients_totals(arr)
def facet_by_provider_ids(arr)
# generate hash with id and name for each provider in facet
ids = arr.map { |hsh| hsh["key"] }.join(",")
providers = Provider.find_by_id_list(ids).results.reduce({}) do |sum, p|
providers = Provider.find_by_id_list(ids, size: 1000).results.reduce({}) do |sum, p|
sum[p.id] = p.name
sum
end
Expand Down

0 comments on commit 5684477

Please sign in to comment.