diff --git a/lib/searchkick/index_options.rb b/lib/searchkick/index_options.rb index be32f8c..64338da 100644 --- a/lib/searchkick/index_options.rb +++ b/lib/searchkick/index_options.rb @@ -225,7 +225,7 @@ module Searchkick } end - settings.deep_merge!(options[:settings] || {}) + settings = settings.symbolize_keys.deep_merge((options[:settings] || {}).symbolize_keys) # synonyms synonyms = options[:synonyms] || [] @@ -311,10 +311,10 @@ module Searchkick if !options[:searchable] || mapping_options[:searchable].include?(field) if word - fields["analyzed"] = analyzed_field_options + fields[:analyzed] = analyzed_field_options if mapping_options[:highlight].include?(field) - fields["analyzed"][:term_vector] = "with_positions_offsets" + fields[:analyzed][:term_vector] = "with_positions_offsets" end end @@ -373,7 +373,7 @@ module Searchkick end if word - dynamic_fields["analyzed"] = analyzed_field_options + dynamic_fields[:analyzed] = analyzed_field_options end end @@ -402,7 +402,7 @@ module Searchkick mappings[index_type][:_all] = all_enabled ? analyzed_field_options : {enabled: false} end - mappings = mappings.deep_merge(options[:mappings] || {}) + mappings = mappings.symbolize_keys.deep_merge((options[:mappings] || {}).symbolize_keys) end { diff --git a/test/routing_test.rb b/test/routing_test.rb index b201529..10cdfa5 100644 --- a/test/routing_test.rb +++ b/test/routing_test.rb @@ -8,7 +8,7 @@ class RoutingTest < Minitest::Test def test_routing_mappings index_options = Store.searchkick_index.index_options - assert_equal index_options[:mappings]["store"][:_routing], required: true + assert_equal index_options[:mappings][:store][:_routing], required: true end def test_routing_correct_node -- libgit2 0.21.0