Class: Elasticity::Bulk::Alias

Inherits:
Elasticity::Bulk show all
Defined in:
lib/elasticity/bulk.rb

Instance Method Summary collapse

Methods inherited from Elasticity::Bulk

#execute

Constructor Details

#initialize(client, update_alias, delete_indexes) ⇒ Alias

Returns a new instance of Alias.



44
45
46
47
48
# File 'lib/elasticity/bulk.rb', line 44

def initialize(client, update_alias, delete_indexes)
  super(client)
  @update_alias   = update_alias
  @delete_indexes = delete_indexes
end

Instance Method Details

#delete(id) ⇒ Object



58
59
60
61
62
# File 'lib/elasticity/bulk.rb', line 58

def delete(id)
  @delete_indexes.each do |index|
    super(index, id)
  end
end

#index(id, attributes) ⇒ Object



50
51
52
# File 'lib/elasticity/bulk.rb', line 50

def index(id, attributes)
  super(@update_alias, id, attributes)
end

#update(id, attributes) ⇒ Object



54
55
56
# File 'lib/elasticity/bulk.rb', line 54

def update(id, attributes)
  super(@update_alias, id, attributes)
end