Commit 049fbfd71537c254b0806a95429b0c7deaefd970
1 parent
5455440f
Exists in
master
and in
21 other branches
Fixed highlight
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/searchkick/results.rb
... | ... | @@ -45,8 +45,8 @@ module Searchkick |
45 | 45 | |
46 | 46 | if hit["highlight"] |
47 | 47 | highlight = Hash[hit["highlight"].map { |k, v| [k.sub(/\.(analyzed|word_start|word_middle|word_end|text_start|text_middle|text_end)\z/, ""), v.first] }] |
48 | - highlight.each do |k, v| | |
49 | - result["highlighted_#{k}"] ||= (v || result[k]) | |
48 | + result.keys.each do |k| | |
49 | + result["highlighted_#{k}"] ||= (highlight[k] || result[k]) | |
50 | 50 | end |
51 | 51 | end |
52 | 52 | ... | ... |