lib/searchkick/index_options.rb in searchkick-3.0.2 vs lib/searchkick/index_options.rb in searchkick-3.0.3

- old
+ new

@@ -9,11 +9,13 @@ if options[:mappings] && !options[:merge_mappings] settings = options[:settings] || {} mappings = options[:mappings] else - below60 = Searchkick.server_below?("6.0.0-alpha1") + below60 = Searchkick.server_below?("6.0.0") + below62 = Searchkick.server_below?("6.2.0") + default_type = "text" default_analyzer = :searchkick_index keyword_mapping = {type: "keyword"} all = options.key?(:_all) ? options[:_all] : false @@ -212,9 +214,16 @@ settings[:number_of_replicas] = 0 end if options[:similarity] settings[:similarity] = {default: {type: options[:similarity]}} + end + + unless below62 + settings[:index] = { + max_ngram_diff: 49, + max_shingle_diff: 4 + } end settings.deep_merge!(options[:settings] || {}) # synonyms