Class: Esse::CLI::Index
- Inherits:
-
Base
- Object
- Thor
- Base
- Esse::CLI::Index
show all
- Defined in:
- lib/esse/cli/index.rb
Defined Under Namespace
Classes: BaseOperation, Close, Create, Delete, Import, Open, Reset, UpdateAliases, UpdateMapping, UpdateSettings
Instance Method Summary
collapse
Instance Method Details
#close(*index_classes) ⇒ Object
76
77
78
79
|
# File 'lib/esse/cli/index.rb', line 76
def close(*index_classes)
require_relative 'index/close'
Close.new(indices: index_classes, **options.to_h.transform_keys(&:to_sym)).run
end
|
#create(*index_classes) ⇒ Object
36
37
38
39
|
# File 'lib/esse/cli/index.rb', line 36
def create(*index_classes)
require_relative 'index/create'
Create.new(indices: index_classes, **options.to_h.transform_keys(&:to_sym)).run
end
|
#delete(*index_classes) ⇒ Object
43
44
45
46
|
# File 'lib/esse/cli/index.rb', line 43
def delete(*index_classes)
require_relative 'index/delete'
Delete.new(indices: index_classes, **options.to_h.transform_keys(&:to_sym)).run
end
|
#import(*index_classes) ⇒ Object
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/esse/cli/index.rb', line 94
def import(*index_classes)
require_relative 'index/import'
opts = HashUtils.deep_transform_keys(options.to_h, &:to_sym)
opts.delete(:lazy_update_document_attributes) if opts[:lazy_update_document_attributes] == 'false'
opts.delete(:eager_include_document_attributes) if opts[:eager_include_document_attributes] == 'false'
if (val = opts[:eager_include_document_attributes])
opts[:eager_include_document_attributes] = (val == 'true') ? true : val.split(',')
end
if (val = opts[:lazy_update_document_attributes])
opts[:lazy_update_document_attributes] = (val == 'true') ? true : val.split(',')
end
Import.new(indices: index_classes, **opts).run
end
|
#open(*index_classes) ⇒ Object
83
84
85
86
|
# File 'lib/esse/cli/index.rb', line 83
def open(*index_classes)
require_relative 'index/open'
Open.new(indices: index_classes, **options.to_h.transform_keys(&:to_sym)).run
end
|
#reset(*index_classes) ⇒ Object
20
21
22
23
|
# File 'lib/esse/cli/index.rb', line 20
def reset(*index_classes)
require_relative 'index/reset'
Reset.new(indices: index_classes, **options.to_h.transform_keys(&:to_sym)).run
end
|
#update_aliases(*index_classes) ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/esse/cli/index.rb', line 50
def update_aliases(*index_classes)
require_relative 'index/update_aliases'
kwargs = options.to_h.transform_keys(&:to_sym)
kwargs[:suffix] = (kwargs[:suffix] || []).flat_map { |s| s.split(',') }.uniq
UpdateAliases.new(indices: index_classes, **kwargs).run
end
|
#update_mapping(*index_classes) ⇒ Object
69
70
71
72
|
# File 'lib/esse/cli/index.rb', line 69
def update_mapping(*index_classes)
require_relative 'index/update_mapping'
UpdateMapping.new(indices: index_classes, **options.to_h.transform_keys(&:to_sym)).run
end
|
#update_settings(*index_classes) ⇒ Object
61
62
63
64
|
# File 'lib/esse/cli/index.rb', line 61
def update_settings(*index_classes)
require_relative 'index/update_settings'
UpdateSettings.new(indices: index_classes, **options.to_h.transform_keys(&:to_sym)).run
end
|