Commit 5c8b4e1e8b1eda2bfbd9bd3e98432161b9ef0350

Authored by Andrew Kane
1 parent fa5db0c8

Removed unnecessary special cases for ES 2 - #796

Showing 1 changed file with 2 additions and 18 deletions   Show diff stats
lib/searchkick/index_options.rb
... ... @@ -252,15 +252,7 @@ module Searchkick
252 252 end
253 253 end
254 254  
255   - mapping[field] =
256   - if below50
257   - {
258   - type: "multi_field",
259   - fields: fields
260   - }
261   - elsif fields[field]
262   - fields[field].merge(fields: fields.except(field))
263   - end
  255 + mapping[field] = fields[field].merge(fields: fields.except(field))
264 256 end
265 257  
266 258 (options[:locations] || []).map(&:to_s).each do |field|
... ... @@ -307,15 +299,7 @@ module Searchkick
307 299 end
308 300  
309 301 # http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/
310   - multi_field =
311   - if below50
312   - {
313   - type: "multi_field",
314   - fields: dynamic_fields
315   - }
316   - else
317   - dynamic_fields["{name}"].merge(fields: dynamic_fields.except("{name}"))
318   - end
  302 + multi_field = dynamic_fields["{name}"].merge(fields: dynamic_fields.except("{name}"))
319 303  
320 304 all_enabled = !options[:searchable] || options[:searchable].to_a.include?("_all")
321 305  
... ...