Module: ElasticSearch::Transport::IndexAdminProtocol

Included in:
BaseProtocol
Defined in:
lib/elasticsearch/transport/base_protocol.rb

Instance Method Summary collapse

Instance Method Details

#alias_index(operations, options = {}) ⇒ Object



86
87
88
# File 'lib/elasticsearch/transport/base_protocol.rb', line 86

def alias_index(operations, options={})
  standard_request(:post, {:op => "_aliases"}, {}, encoder.encode(operations))
end

#create_index(index, create_options = {}, options = {}) ⇒ Object



78
79
80
# File 'lib/elasticsearch/transport/base_protocol.rb', line 78

def create_index(index, create_options={}, options={})
  standard_request(:put, {:index => index}, {}, encoder.encode(create_options))
end

#delete_index(index, options = {}) ⇒ Object



82
83
84
# File 'lib/elasticsearch/transport/base_protocol.rb', line 82

def delete_index(index, options={})
  standard_request(:delete, {:index => index})
end

#flush(index_list, options = {}) ⇒ Object



94
95
96
# File 'lib/elasticsearch/transport/base_protocol.rb', line 94

def flush(index_list, options={})
  standard_request(:post, {:index => index_list, :op => "_flush"}, options, "")
end

#index_status(index_list, options = {}) ⇒ Object



74
75
76
# File 'lib/elasticsearch/transport/base_protocol.rb', line 74

def index_status(index_list, options={})
  standard_request(:get, {:index => index_list, :op => "_status"})
end

#optimize(index_list, options = {}) ⇒ Object



106
107
108
# File 'lib/elasticsearch/transport/base_protocol.rb', line 106

def optimize(index_list, options={})
  standard_request(:post, {:index => index_list, :op => "_optimize"}, options, {}, "")
end

#refresh(index_list, options = {}) ⇒ Object



98
99
100
# File 'lib/elasticsearch/transport/base_protocol.rb', line 98

def refresh(index_list, options={})
  standard_request(:post, {:index => index_list, :op => "_refresh"}, {}, "")
end

#snapshot(index_list, options = {}) ⇒ Object



102
103
104
# File 'lib/elasticsearch/transport/base_protocol.rb', line 102

def snapshot(index_list, options={})
  standard_request(:post, {:index => index_list, :type => "_gateway", :op => "snapshot"}, {}, "")
end

#update_mapping(index, type, mapping, options) ⇒ Object



90
91
92
# File 'lib/elasticsearch/transport/base_protocol.rb', line 90

def update_mapping(index, type, mapping, options)
  standard_request(:put, {:index => index, :type => type, :op => "_mapping"}, options, encoder.encode(mapping))
end