From f759a8af65124374279ecfecd6115bd12efa4d59 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Tue, 3 Feb 2015 12:25:11 +0000 Subject: Do not allow requests for search results after the first 500 The pages for these search results are extremely slow to load. This is not an ideal solution by any means. Really we want to dig into why high offsets are so slow, and whether there's anything we can do to fix that. --- spec/controllers/general_controller_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/controllers/general_controller_spec.rb') diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb index cb00b301c..8652d9b17 100644 --- a/spec/controllers/general_controller_spec.rb +++ b/spec/controllers/general_controller_spec.rb @@ -262,4 +262,10 @@ describe GeneralController, 'when using xapian search' do response.body.should include('Track this search') end + it 'should not show high page offsets as these are extremely slow to generate' do + lambda { + get :search, :combined => 'bob/all', :page => 25 + }.should raise_error(ActiveRecord::RecordNotFound) + end + end -- cgit v1.2.3