summaryrefslogtreecommitdiff
path: root/app/services/search_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/search_service.rb')
-rw-r--r--app/services/search_service.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/services/search_service.rb b/app/services/search_service.rb
index 3ccd67c8d30..84d7e33c3d0 100644
--- a/app/services/search_service.rb
+++ b/app/services/search_service.rb
@@ -62,7 +62,9 @@ class SearchService
end
def search_objects(preload_method = nil)
- @search_objects ||= redact_unauthorized_results(search_results.objects(scope, page: params[:page], per_page: per_page, preload_method: preload_method))
+ @search_objects ||= redact_unauthorized_results(
+ search_results.objects(scope, page: page, per_page: per_page, preload_method: preload_method)
+ )
end
def search_highlight
@@ -71,6 +73,10 @@ class SearchService
private
+ def page
+ [1, params[:page].to_i].max
+ end
+
def per_page
per_page_param = params[:per_page].to_i