aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/general_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-06-04 11:49:34 +0100
committerLouise Crow <louise.crow@gmail.com>2013-06-04 11:49:34 +0100
commitf6bb0e5d33ceb5beb80f9561b77c716a04f574a2 (patch)
tree135c5ccefc742e471f4b74ddf0688aace10a70d7 /app/controllers/general_controller.rb
parentc304f25a8950f61215ef2fae1e7feb71cfbfeb56 (diff)
parent9727c7b62fd3fe7b00cfc64cb4b36ba445a3a960 (diff)
Merge remote-tracking branch 'openaustralia_github/inline_search_method_refactor' into rails-3-develop
Diffstat (limited to 'app/controllers/general_controller.rb')
-rw-r--r--app/controllers/general_controller.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 4fd0c3deb..52b4b3e0e 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -153,7 +153,7 @@ class GeneralController < ApplicationController
# structured query which should show newest first, rather than a free text search
# where we want most relevant as default.
begin
- dummy_query = ::ActsAsXapian::Search.new([InfoRequestEvent], @query, :limit => 1)
+ dummy_query = ActsAsXapian::Search.new([InfoRequestEvent], @query, :limit => 1)
rescue => e
flash[:error] = "Your query was not quite right. " + CGI.escapeHTML(e.to_str)
redirect_to search_url("")
@@ -169,10 +169,8 @@ class GeneralController < ApplicationController
# Query each type separately for separate display (XXX we are calling
# perform_search multiple times and it clobbers per_page for each one,
# so set as separate var)
- requests_per_page = 25
- if params[:requests_per_page]
- requests_per_page = params[:requests_per_page].to_i
- end
+ requests_per_page = params[:requests_per_page] ? params[:requests_per_page].to_i : 25
+
@this_page_hits = @total_hits = @xapian_requests_hits = @xapian_bodies_hits = @xapian_users_hits = 0
if @requests
@xapian_requests = perform_search([InfoRequestEvent], @query, @sortby, 'request_collapse', requests_per_page)