Fix tootctl search deploy --only-mapping not updating index settings (#34566)

This commit is contained in:
Eugen Rochko 2025-04-28 15:02:41 +02:00 committed by GitHub
parent 40157e063d
commit bd9223f0b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -12,6 +12,13 @@ module Chewy
base_options.merge(number_of_replicas: 1, number_of_shards: (base_options[:number_of_shards] || 1) * 2) base_options.merge(number_of_replicas: 1, number_of_shards: (base_options[:number_of_shards] || 1) * 2)
end end
end end
def update_specification
client.indices.close index: index_name
client.indices.put_settings index: index_name, body: { settings: { analysis: settings_hash[:settings][:analysis] } }
client.indices.put_mapping index: index_name, body: root.mappings_hash
client.indices.open index: index_name
end
end end
end end

View File

@ -56,7 +56,7 @@ module Mastodon::CLI
if options[:only_mapping] if options[:only_mapping]
indices.select { |index| index.specification.changed? }.each do |index| indices.select { |index| index.specification.changed? }.each do |index|
progress.title = "Updating mapping for #{index} " progress.title = "Updating mapping for #{index} "
index.update_mapping index.update_specification
index.specification.lock! index.specification.lock!
end end