Class: IndexDsl
Instance Method Summary
collapse
#operation_list, template
#alias_index_op, #create_index_op, #delete_index_op, #update_mapping_op, #update_settings_op
define, perform
#getset, #getset_collection_item
Instance Method Details
#index_settings ⇒ Object
105
106
107
|
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 105
def index_settings
{ number_of_replicas: number_of_replicas }.compact_blank
end
|
#receive_alias_to(params) ⇒ Object
95
96
97
98
|
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 95
def receive_alias_to params
params.each{ |als| operation_list << alias_index_op(:add, self.name, als) }
super(params)
end
|
#receive_create_mapping(attrs, &block) ⇒ Object
77
78
79
80
81
|
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 77
def receive_create_mapping(attrs, &block)
obj = ObjectDsl.receive(attrs, &block)
operation_list << update_mapping_op(self.name, obj.name, obj.to_mapping)
obj
end
|
#receive_delete_mapping(attrs, &block) ⇒ Object
89
90
91
92
93
|
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 89
def receive_delete_mapping(attrs, &block)
obj = ObjectDsl.receive(attrs, &block)
operation_list.unshift update_mapping_op(self.name, obj.name, obj.to_mapping)
obj
end
|
#receive_remove_alias(params) ⇒ Object
100
101
102
103
|
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 100
def receive_remove_alias params
params.each{ |als| operation_list << alias_index_op(:remove, self.name, als) }
super(params)
end
|
#receive_update_mapping(attrs, &block) ⇒ Object
83
84
85
86
87
|
# File 'lib/wukong-migrate/elasticsearch_migration.rb', line 83
def receive_update_mapping(attrs, &block)
obj = ObjectDsl.receive(attrs, &block)
operation_list << update_mapping_op(self.name, obj.name, obj.to_mapping)
obj
end
|