Commit f36b2ffbbc4393c402f65c389e65fdf3c9b77055
1 parent
f22aa73d
Exists in
master
and in
19 other branches
Fixed issue with _all field in searchable [skip ci]
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/index_options.rb
... | ... | @@ -227,6 +227,8 @@ module Searchkick |
227 | 227 | |
228 | 228 | word = options[:word] != false && (!options[:match] || options[:match] == :word) |
229 | 229 | |
230 | + mapping_options[:searchable].delete("_all") | |
231 | + | |
230 | 232 | mapping_options.values.flatten.uniq.each do |field| |
231 | 233 | fields = {} |
232 | 234 | |
... | ... | @@ -301,7 +303,7 @@ module Searchkick |
301 | 303 | # http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/ |
302 | 304 | multi_field = dynamic_fields["{name}"].merge(fields: dynamic_fields.except("{name}")) |
303 | 305 | |
304 | - all_enabled = !options[:searchable] || options[:searchable].to_a.include?("_all") | |
306 | + all_enabled = !options[:searchable] || options[:searchable].to_a.map(&:to_s).include?("_all") | |
305 | 307 | |
306 | 308 | mappings = { |
307 | 309 | _default_: { | ... | ... |