searchkick
searchkick copied to clipboard
Use deep_merge for `model_options`
This PR adds support for nested parameters to model_options
. For example,
Searchkick.model_options = {
settings: {
number_of_shards: 1,
number_of_replicas: 0,
},
}
class Product < ApplicationRecord
searchkick settings: {
analysis: {
tokenizer: {
kuromoji_with_dictionary: {...},
},
analyzer: { ... },
},
}
end
with code above, number_of_shards/replicas are ignored previously, but these are considered in this PR. I guess this behaviour is expected because similar feature client_options is deep_merged.
Note: I haven't written any tests for this PR since there aren't any existing tests for model_options or client_options. Should I add some tests?