Skip to content
Permalink
Browse files

Better code [skip ci]

  • Loading branch information...
ankane committed May 7, 2019
1 parent 5d8cdd0 commit edbb1c9b213cef7776e88792cd8020a52022107f
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/searchkick/index_options.rb
@@ -13,10 +13,10 @@ def index_options
index_type = index_type.call if index_type.respond_to?(:call)
end

custom_mapping = (options[:mapping] || {}).symbolize_keys
if below70 && custom_mapping.any? && custom_mapping.key?(:properties)
custom_mapping = options[:mapping] || {}
if below70 && custom_mapping.keys.map(&:to_sym).include?(:properties)
# add type
custom_mapping = {index_type.to_sym => custom_mapping}
custom_mapping = {index_type => custom_mapping}
end

if options[:mappings] && !options[:merge_mappings]
@@ -426,7 +426,7 @@ def index_options
mappings = {index_type => mappings}
end

mappings = mappings.symbolize_keys.deep_merge(custom_mapping)
mappings = mappings.symbolize_keys.deep_merge(custom_mapping.symbolize_keys)
end

{

0 comments on commit edbb1c9

Please sign in to comment.
You can’t perform that action at this time.