diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-06-04 11:49:34 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-06-04 11:49:34 +0100 |
commit | f6bb0e5d33ceb5beb80f9561b77c716a04f574a2 (patch) | |
tree | 135c5ccefc742e471f4b74ddf0688aace10a70d7 /app/controllers/application_controller.rb | |
parent | c304f25a8950f61215ef2fae1e7feb71cfbfeb56 (diff) | |
parent | 9727c7b62fd3fe7b00cfc64cb4b36ba445a3a960 (diff) |
Merge remote-tracking branch 'openaustralia_github/inline_search_method_refactor' into rails-3-develop
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2615b61f2..3a1ec95cc 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -358,12 +358,15 @@ class ApplicationController < ActionController::Base # Peform the search @per_page = per_page - if this_page.nil? - @page = get_search_page_from_params - else - @page = this_page - end - result = InfoRequest.full_search(models, @query, order, ascending, collapse, @per_page, @page) + @page = this_page || get_search_page_from_params + + result = ActsAsXapian::Search.new(models, @query, + :offset => (@page - 1) * @per_page, + :limit => @per_page, + :sort_by_prefix => order, + :sort_by_ascending => ascending, + :collapse_by_prefix => collapse + ) result.results # Touch the results to load them, otherwise accessing them from the view # might fail later if the database has subsequently been reopened. return result |