File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,15 @@ def path_encode(path, *args)
53
53
# Support to convert old settings to their new names
54
54
#
55
55
def deserialize_settings ( data , symbolize_keys )
56
- settings = symbolize_hash ( data )
56
+ settings = data
57
57
keys = {
58
58
attributesToIndex : 'searchableAttributes' ,
59
59
numericAttributesToIndex : 'numericAttributesForFiltering' ,
60
60
slaves : 'replicas'
61
61
}
62
62
63
63
keys . each do |deprecated_key , current_key |
64
+ deprecated_key = symbolize_keys ? deprecated_key : deprecated_key . to_s
64
65
if settings . has_key? ( deprecated_key )
65
66
key = symbolize_keys ? current_key . to_sym : current_key . to_s
66
67
settings [ key ] = settings . delete ( deprecated_key )
Original file line number Diff line number Diff line change @@ -26,13 +26,15 @@ def test_deserialize_settings_with_string
26
26
old_settings = {
27
27
'attributesToIndex' => %w( attr1 attr2 ) ,
28
28
'numericAttributesToIndex' => %w( attr1 attr2 ) ,
29
- 'slaves' => %w( index1 index2 )
29
+ 'slaves' => %w( index1 index2 ) ,
30
+ 'minWordSizefor1Typo' => 1
30
31
}
31
32
32
33
new_settings = {
33
34
'searchableAttributes' => %w( attr1 attr2 ) ,
34
35
'numericAttributesForFiltering' => %w( attr1 attr2 ) ,
35
- 'replicas' => %w( index1 index2 )
36
+ 'replicas' => %w( index1 index2 ) ,
37
+ 'minWordSizefor1Typo' => 1
36
38
}
37
39
38
40
deserialized_settings = deserialize_settings ( old_settings , false )
You can’t perform that action at this time.
0 commit comments