diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-11-07 14:08:35 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-11-07 14:09:15 +0000 |
commit | b2a2757e12e8eeda174da362a6acff6e460f922f (patch) | |
tree | 8d479d7925cfd009c841361ef75b6c4d1acc0e6e /app/controllers/general_controller.rb | |
parent | 99acbc6387d1789bdf950f20c99261ab5b0cbd7b (diff) |
Show highlights and correction regardless of search type.
Contributes to #1118.
Diffstat (limited to 'app/controllers/general_controller.rb')
-rw-r--r-- | app/controllers/general_controller.rb | 11 |
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) |