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,7 +45,7 @@ module Searchkick | ||
45 | 45 | ||
46 | if hit["highlight"] | 46 | if hit["highlight"] |
47 | highlight = Hash[hit["highlight"].map { |k, v| [base_field(k), v.first] }] | 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 | result["highlighted_#{k}"] ||= (highlight[k] || result[k]) | 49 | result["highlighted_#{k}"] ||= (highlight[k] || result[k]) |
50 | end | 50 | end |
51 | end | 51 | end |
@@ -199,7 +199,7 @@ module Searchkick | @@ -199,7 +199,7 @@ module Searchkick | ||
199 | end | 199 | end |
200 | 200 | ||
201 | def base_field(k) | 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 | end | 203 | end |
204 | end | 204 | end |
205 | end | 205 | end |