From da691988d0cb72231f1863e4367899b6cf6160e2 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 18 Oct 2018 22:19:12 +0200 Subject: [PATCH] limit total number of paged results to 10000 --- app/controllers/dois_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 460f6f2db..b41c49ee5 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -50,7 +50,7 @@ def index end total = response.results.total - total_pages = page[:size] > 0 ? (total.to_f / page[:size]).ceil : 0 + total_pages = page[:size] > 0 ? ([total.to_f, 10000].min / page[:size]).ceil : 0 states = total > 0 ? facet_by_key(response.response.aggregations.states.buckets) : nil resource_types = total > 0 ? facet_by_resource_type(response.response.aggregations.resource_types.buckets) : nil