Class: Elastics::Indices
Instance Method Summary
collapse
deep_dup, deep_merge, deep_merge!
Constructor Details
#initialize(config_path) ⇒ Indices
Returns a new instance of Indices.
Instance Method Details
#create_index(index, name = nil, opts = {}) ⇒ Object
11
12
13
14
|
# File 'lib/elastics/indices.rb', line 11
def create_index(index, name=nil, opts={})
name ||= index
Elastics.PUT name, self[index], opts
end
|
#create_indices(indices = keys, opts = {}) ⇒ Object
16
17
18
|
# File 'lib/elastics/indices.rb', line 16
def create_indices(indices=keys, opts={})
indices.each{|i| create_index(i, i, opts)}
end
|
#delete_indices(indices = keys, opts = {}) ⇒ Object
20
21
22
23
24
25
|
# File 'lib/elastics/indices.rb', line 20
def delete_indices(indices=keys, opts={})
indices.each do |i|
args = {:index=>i}.merge(opts)
Elastics.delete_index(args)
end
end
|