Class: Esse::CLI::Index::UpdateMapping
- Inherits:
-
BaseOperation
- Object
- BaseOperation
- Esse::CLI::Index::UpdateMapping
- Defined in:
- lib/esse/cli/index/update_mapping.rb
Instance Method Summary collapse
Methods inherited from BaseOperation
Methods included from Output
colorize, formatted_runtime, print_backtrace, print_error, print_message, runtime_padding
Constructor Details
This class inherits a constructor from Esse::CLI::Index::BaseOperation
Instance Method Details
#run ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/esse/cli/index/update_mapping.rb', line 8 def run indices.each do |index| if !index.mapping_single_type? # Elasticsearch 6.x and older have multiple types per index. # This gem supports multiple types per index for backward compatibility, but we recommend to update # your elasticsearch to a at least 7.x version and use a single type per index. # # Note that the repository name will be used as the document type. index.repo_hash.keys.each do |doc_type| index.update_mapping(type: doc_type, **) end else index.update_mapping(**) end end end |