Fixed issue #2297 - rake searchindex:rebuild is not working after Elasticsearch 2.4 upgrade to Elasticsearch 5.6 "Limit of total fields [1000] in index"

This commit is contained in:
Martin Edenhofer 2018-10-19 00:40:57 +02:00
parent e8e0bf93b9
commit c8ab4275d6

View file

@ -24,6 +24,9 @@ namespace :searchindex do
number = info['version']['number'].to_s
end
settings = {
'index.mapping.total_fields.limit': 2000,
}
mapping = {}
Models.indexable.each do |local_object|
mapping.merge!(get_mapping_properties_object(local_object))
@ -33,7 +36,8 @@ namespace :searchindex do
SearchIndexBackend.index(
action: 'create',
data: {
mappings: mapping
mappings: mapping,
settings: settings,
}
)