Commit f36b2ffbbc4393c402f65c389e65fdf3c9b77055

Authored by Andrew Kane
1 parent f22aa73d

Fixed issue with _all field in searchable [skip ci]

Showing 2 changed files with 7 additions and 1 deletions   Show diff stats
CHANGELOG.md
  1 +## 2.1.2 [unreleased]
  2 +
  3 +- Fixed issue with `_all` field in `searchable`
  4 +
1 5 ## 2.1.1
2 6  
3 7 - Fixed duplicate notifications
... ...
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_: {
... ...