lib/searchkick/index_options.rb in searchkick-2.1.1 vs lib/searchkick/index_options.rb in searchkick-2.2.0

- old
+ new

@@ -23,11 +23,11 @@ { type: "keyword" } end - keyword_mapping[:ignore_above] = (options[:ignore_above] || 256) unless below22 + keyword_mapping[:ignore_above] = (options[:ignore_above] || 30000) unless below22 settings = { analysis: { analyzer: { searchkick_keyword: { @@ -225,10 +225,12 @@ .map { |type| [type, (options[type] || []).map(&:to_s)] } ] word = options[:word] != false && (!options[:match] || options[:match] == :word) + mapping_options[:searchable].delete("_all") + mapping_options.values.flatten.uniq.each do |field| fields = {} if options.key?(:filterable) && !mapping_options[:filterable].include?(field) fields[field] = {type: default_type, index: "no"} @@ -284,12 +286,10 @@ if options.key?(:filterable) dynamic_fields["{name}"] = {type: default_type, index: "no"} end - dynamic_fields["{name}"][:ignore_above] = (options[:ignore_above] || 256) unless below22 - unless options[:searchable] if options[:match] && options[:match] != :word dynamic_fields[options[:match]] = {type: default_type, index: "analyzed", analyzer: "searchkick_#{options[:match]}_index"} end @@ -299,10 +299,10 @@ end # http://www.elasticsearch.org/guide/reference/mapping/multi-field-type/ multi_field = dynamic_fields["{name}"].merge(fields: dynamic_fields.except("{name}")) - all_enabled = !options[:searchable] || options[:searchable].to_a.include?("_all") + all_enabled = !options[:searchable] || options[:searchable].to_a.map(&:to_s).include?("_all") mappings = { _default_: { _all: all_enabled ? {type: default_type, index: "analyzed", analyzer: default_analyzer} : {enabled: false}, properties: mapping,