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



122
123
124
# File 'lib/elasticsearch/transport/base_protocol.rb', line 122

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

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



114
115
116
# File 'lib/elasticsearch/transport/base_protocol.rb', line 114

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

#create_river(type, create_options = {}, options = {}) ⇒ Object



166
167
168
# File 'lib/elasticsearch/transport/base_protocol.rb', line 166

def create_river(type, create_options={}, options={})
  standard_request(:put, {:index => "_river", :type => type, :op => "_meta"}, options, encoder.encode(create_options))
end

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



118
119
120
# File 'lib/elasticsearch/transport/base_protocol.rb', line 118

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

#delete_mapping(index, type, options = {}) ⇒ Object



138
139
140
# File 'lib/elasticsearch/transport/base_protocol.rb', line 138

def delete_mapping(index, type, options={})
  standard_request(:delete, {:index => index, :type => type, :op => "_mapping"})
end

#delete_river(type, options = {}) ⇒ Object



178
179
180
181
182
# File 'lib/elasticsearch/transport/base_protocol.rb', line 178

def delete_river(type, options={})
  params = {:index => "_river"}
  params[:type] = type unless type.nil?
  standard_request(:delete, params)
end

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



150
151
152
# File 'lib/elasticsearch/transport/base_protocol.rb', line 150

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

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



126
127
128
# File 'lib/elasticsearch/transport/base_protocol.rb', line 126

def get_aliases(index, options={})
  standard_request(:get, {:index => index, :op => "_aliases"}, options)
end

#get_river(type, options = {}) ⇒ Object



170
171
172
# File 'lib/elasticsearch/transport/base_protocol.rb', line 170

def get_river(type, options={})
  standard_request(:get, {:index => "_river", :type => type, :op => "_meta"})
end

#get_settings(index, options) ⇒ Object



146
147
148
# File 'lib/elasticsearch/transport/base_protocol.rb', line 146

def get_settings(index, options)
  standard_request(:get, {:index => index, :op => "_settings"}, options)
end

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



134
135
136
# File 'lib/elasticsearch/transport/base_protocol.rb', line 134

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

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



110
111
112
# File 'lib/elasticsearch/transport/base_protocol.rb', line 110

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

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



162
163
164
# File 'lib/elasticsearch/transport/base_protocol.rb', line 162

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

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



154
155
156
# File 'lib/elasticsearch/transport/base_protocol.rb', line 154

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

#river_status(type, options = {}) ⇒ Object



174
175
176
# File 'lib/elasticsearch/transport/base_protocol.rb', line 174

def river_status(type, options={})
  standard_request(:get, {:index => "_river", :type => type, :op => "_status"})
end

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



158
159
160
# File 'lib/elasticsearch/transport/base_protocol.rb', line 158

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

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



130
131
132
# File 'lib/elasticsearch/transport/base_protocol.rb', line 130

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

#update_settings(index, settings, options) ⇒ Object



142
143
144
# File 'lib/elasticsearch/transport/base_protocol.rb', line 142

def update_settings(index, settings, options)
  standard_request(:put, {:index => index, :op => "_settings"}, options, encoder.encode(settings))
end