class IndexDsl

Public Instance Methods

index_settings() click to toggle source
# File lib/wukong-migrate/elasticsearch_migration.rb, line 103
def index_settings
  { number_of_replicas: number_of_replicas }.compact_blank
end
receive_alias_to(attrs, &block) click to toggle source
# File lib/wukong-migrate/elasticsearch_migration.rb, line 95
def receive_alias_to(attrs, &block)
  operation_list << alias_index_op(:add, self.name, attrs[:name], attrs[:filter])
end
receive_create_mapping(attrs, &block) click to toggle source
# 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) click to toggle source
# 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(attrs, &block) click to toggle source
# File lib/wukong-migrate/elasticsearch_migration.rb, line 99
def receive_remove_alias(attrs, &block)
  operation_list << alias_index_op(:remove, self.name, attrs[:name], attrs[:filter])
end
receive_update_mapping(attrs, &block) click to toggle source
# 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