aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/general_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-11-12 10:43:06 +0000
committerLouise Crow <louise.crow@gmail.com>2013-11-12 10:43:06 +0000
commit49ec8adf7027992377f8e322ef69db503e6eb94a (patch)
treee95fcbff40134be33130467ba4d5e10fee6e4605 /app/controllers/general_controller.rb
parent4598c4d5c03e026c00881f0ecfd51c8ef33ea9aa (diff)
parent3a9c244e75d44a0a65b51eb1144a0b2d64911a75 (diff)
Merge branch 'rails-3-develop' of ssh://git.mysociety.org/data/git/public/alaveteli into rails-3-develop
Diffstat (limited to 'app/controllers/general_controller.rb')
-rw-r--r--app/controllers/general_controller.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 540f67ec9..beefef4e6 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -178,6 +178,7 @@ class GeneralController < ApplicationController
@xapian_requests_hits = @xapian_requests.results.size
@xapian_requests_total_hits = @xapian_requests.matches_estimated
@total_hits += @xapian_requests.matches_estimated
+ @request_for_spelling = @xapian_requests
end
if @bodies
@xapian_bodies = perform_search([PublicBody], @query, @sortby, nil, 5)
@@ -186,6 +187,7 @@ class GeneralController < ApplicationController
@xapian_bodies_hits = @xapian_bodies.results.size
@xapian_bodies_total_hits = @xapian_bodies.matches_estimated
@total_hits += @xapian_bodies.matches_estimated
+ @request_for_spelling = @xapian_bodies
end
if @users
@xapian_users = perform_search([User], @query, @sortby, nil, 5)
@@ -194,14 +196,13 @@ class GeneralController < ApplicationController
@xapian_users_hits = @xapian_users.results.size
@xapian_users_total_hits = @xapian_users.matches_estimated
@total_hits += @xapian_users.matches_estimated
+ @request_for_spelling = @xapian_users
end
# Spelling and highight words are same for all three queries
- if !@xapian_requests.nil?
- @highlight_words = @xapian_requests.words_to_highlight
- if !(@xapian_requests.spelling_correction =~ /[a-z]+:/)
- @spelling_correction = @xapian_requests.spelling_correction
- end
+ @highlight_words = @request_for_spelling.words_to_highlight
+ if !(@request_for_spelling.spelling_correction =~ /[a-z]+:/)
+ @spelling_correction = @request_for_spelling.spelling_correction
end
@track_thing = TrackThing.create_track_for_search_query(@query, @variety_postfix)