Commit 643e057e6e0d787ba184b9a90f7689b9755a3112
1 parent
a430c446
Exists in
master
and in
21 other branches
Fixed base field error
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/searchkick/results.rb
... | ... | @@ -45,7 +45,7 @@ module Searchkick |
45 | 45 | |
46 | 46 | if hit["highlight"] |
47 | 47 | highlight = Hash[hit["highlight"].map { |k, v| [base_field(k), v.first] }] |
48 | - options[:highlighted_fields].map(&:base_field).each do |k| | |
48 | + options[:highlighted_fields].map{ |k| base_field(k) }.each do |k| | |
49 | 49 | result["highlighted_#{k}"] ||= (highlight[k] || result[k]) |
50 | 50 | end |
51 | 51 | end |
... | ... | @@ -199,7 +199,7 @@ module Searchkick |
199 | 199 | end |
200 | 200 | |
201 | 201 | def base_field(k) |
202 | - k.sub(/\.(analyzed|word_start|word_middle|word_end|text_start|text_middle|text_end)\z/, "") | |
202 | + k.sub(/\.(analyzed|word_start|word_middle|word_end|text_start|text_middle|text_end|exact)\z/, "") | |
203 | 203 | end |
204 | 204 | end |
205 | 205 | end | ... | ... |