Module: Elasticsearch::API::Indices::Actions
- Included in:
- IndicesClient
- Defined in:
- lib/elasticsearch/api/namespace/indices.rb,
lib/elasticsearch/api/actions/indices/get.rb,
lib/elasticsearch/api/actions/indices/open.rb,
lib/elasticsearch/api/actions/indices/clone.rb,
lib/elasticsearch/api/actions/indices/close.rb,
lib/elasticsearch/api/actions/indices/flush.rb,
lib/elasticsearch/api/actions/indices/split.rb,
lib/elasticsearch/api/actions/indices/stats.rb,
lib/elasticsearch/api/actions/indices/create.rb,
lib/elasticsearch/api/actions/indices/delete.rb,
lib/elasticsearch/api/actions/indices/exists.rb,
lib/elasticsearch/api/actions/indices/freeze.rb,
lib/elasticsearch/api/actions/indices/shrink.rb,
lib/elasticsearch/api/actions/indices/analyze.rb,
lib/elasticsearch/api/actions/indices/refresh.rb,
lib/elasticsearch/api/actions/indices/upgrade.rb,
lib/elasticsearch/api/actions/indices/recovery.rb,
lib/elasticsearch/api/actions/indices/rollover.rb,
lib/elasticsearch/api/actions/indices/segments.rb,
lib/elasticsearch/api/actions/indices/unfreeze.rb,
lib/elasticsearch/api/actions/indices/get_alias.rb,
lib/elasticsearch/api/actions/indices/put_alias.rb,
lib/elasticsearch/api/actions/indices/forcemerge.rb,
lib/elasticsearch/api/actions/indices/clear_cache.rb,
lib/elasticsearch/api/actions/indices/exists_type.rb,
lib/elasticsearch/api/actions/indices/get_mapping.rb,
lib/elasticsearch/api/actions/indices/get_upgrade.rb,
lib/elasticsearch/api/actions/indices/put_mapping.rb,
lib/elasticsearch/api/actions/indices/delete_alias.rb,
lib/elasticsearch/api/actions/indices/exists_alias.rb,
lib/elasticsearch/api/actions/indices/flush_synced.rb,
lib/elasticsearch/api/actions/indices/get_settings.rb,
lib/elasticsearch/api/actions/indices/get_template.rb,
lib/elasticsearch/api/actions/indices/put_settings.rb,
lib/elasticsearch/api/actions/indices/put_template.rb,
lib/elasticsearch/api/actions/indices/shard_stores.rb,
lib/elasticsearch/api/actions/indices/update_aliases.rb,
lib/elasticsearch/api/actions/indices/validate_query.rb,
lib/elasticsearch/api/actions/indices/delete_template.rb,
lib/elasticsearch/api/actions/indices/exists_template.rb,
lib/elasticsearch/api/actions/indices/params_registry.rb,
lib/elasticsearch/api/actions/indices/get_field_mapping.rb
Defined Under Namespace
Modules: ParamsRegistry
Instance Method Summary collapse
- #analyze(arguments = {}) ⇒ Object
- #clear_cache(arguments = {}) ⇒ Object
- #clone(arguments = {}) ⇒ Object
- #close(arguments = {}) ⇒ Object
- #create(arguments = {}) ⇒ Object
- #delete(arguments = {}) ⇒ Object
- #delete_alias(arguments = {}) ⇒ Object
- #delete_template(arguments = {}) ⇒ Object
- #exists(arguments = {}) ⇒ Object (also: #exists?)
- #exists_alias(arguments = {}) ⇒ Object (also: #exists_alias?)
- #exists_template(arguments = {}) ⇒ Object (also: #exists_template?)
- #exists_type(arguments = {}) ⇒ Object (also: #exists_type?)
- #flush(arguments = {}) ⇒ Object
- #flush_synced(arguments = {}) ⇒ Object
- #forcemerge(arguments = {}) ⇒ Object
-
#freeze(arguments = {}) ⇒ Object
In order to keep indices available and queryable for a longer period but at the same time reduce their hardware requirements they can be transitioned into a frozen state.
- #get(arguments = {}) ⇒ Object
- #get_alias(arguments = {}) ⇒ Object
-
#get_field_mapping(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0.
-
#get_mapping(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0.
- #get_settings(arguments = {}) ⇒ Object
- #get_template(arguments = {}) ⇒ Object
- #get_upgrade(arguments = {}) ⇒ Object
- #open(arguments = {}) ⇒ Object
- #put_alias(arguments = {}) ⇒ Object
-
#put_mapping(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0.
- #put_settings(arguments = {}) ⇒ Object
- #put_template(arguments = {}) ⇒ Object
- #recovery(arguments = {}) ⇒ Object
- #refresh(arguments = {}) ⇒ Object
- #rollover(arguments = {}) ⇒ Object
- #segments(arguments = {}) ⇒ Object
- #shard_stores(arguments = {}) ⇒ Object
- #shrink(arguments = {}) ⇒ Object
- #split(arguments = {}) ⇒ Object
- #stats(arguments = {}) ⇒ Object
-
#unfreeze(arguments = {}) ⇒ Object
In order to keep indices available and queryable for a longer period but at the same time reduce their hardware requirements they can be transitioned into a frozen state.
- #update_aliases(arguments = {}) ⇒ Object
- #upgrade(arguments = {}) ⇒ Object
-
#validate_query(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0.
Instance Method Details
#analyze(arguments = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/elasticsearch/api/actions/indices/analyze.rb', line 18 def analyze(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index "#{Utils.__listify(_index)}/_analyze" else "_analyze" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#clear_cache(arguments = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/elasticsearch/api/actions/indices/clear_cache.rb', line 26 def clear_cache(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.__listify(_index)}/_cache/clear" else "_cache/clear" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#clone(arguments = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/api/actions/indices/clone.rb', line 21 def clone(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'target' missing" unless arguments[:target] arguments = arguments.clone _index = arguments.delete(:index) _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_PUT path = "#{Utils.__listify(_index)}/_clone/#{Utils.__listify(_target)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#close(arguments = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/api/actions/indices/close.rb', line 24 def close(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "#{Utils.__listify(_index)}/_close" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#create(arguments = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/elasticsearch/api/actions/indices/create.rb', line 21 def create(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_PUT path = "#{Utils.__listify(_index)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#delete(arguments = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/elasticsearch/api/actions/indices/delete.rb', line 22 def delete(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_DELETE path = "#{Utils.__listify(_index)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { perform_request(method, path, params, body).body } else perform_request(method, path, params, body).body end end |
#delete_alias(arguments = {}) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/api/actions/indices/delete_alias.rb', line 19 def delete_alias(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone _index = arguments.delete(:index) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE path = if _index && _name "#{Utils.__listify(_index)}/_aliases/#{Utils.__listify(_name)}" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#delete_template(arguments = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/delete_template.rb', line 18 def delete_template(arguments = {}) raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE path = "_template/#{Utils.__listify(_name)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { perform_request(method, path, params, body).body } else perform_request(method, path, params, body).body end end |
#exists(arguments = {}) ⇒ Object Also known as: exists?
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/elasticsearch/api/actions/indices/exists.rb', line 24 def exists(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_HEAD path = "#{Utils.__listify(_index)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil Utils.__rescue_from_not_found do perform_request(method, path, params, body).status == 200 ? true : false end end |
#exists_alias(arguments = {}) ⇒ Object Also known as: exists_alias?
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/elasticsearch/api/actions/indices/exists_alias.rb', line 23 def exists_alias(arguments = {}) raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone _name = arguments.delete(:name) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_HEAD path = if _index && _name "#{Utils.__listify(_index)}/_alias/#{Utils.__listify(_name)}" else "_alias/#{Utils.__listify(_name)}" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil Utils.__rescue_from_not_found do perform_request(method, path, params, body).status == 200 ? true : false end end |
#exists_template(arguments = {}) ⇒ Object Also known as: exists_template?
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/exists_template.rb', line 19 def exists_template(arguments = {}) raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_HEAD path = "_template/#{Utils.__listify(_name)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil Utils.__rescue_from_not_found do perform_request(method, path, params, body).status == 200 ? true : false end end |
#exists_type(arguments = {}) ⇒ Object Also known as: exists_type?
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/elasticsearch/api/actions/indices/exists_type.rb', line 23 def exists_type(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'type' missing" unless arguments[:type] arguments = arguments.clone _index = arguments.delete(:index) _type = arguments.delete(:type) method = Elasticsearch::API::HTTP_HEAD path = "#{Utils.__listify(_index)}/_mapping/#{Utils.__listify(_type)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil Utils.__rescue_from_not_found do perform_request(method, path, params, body).status == 200 ? true : false end end |
#flush(arguments = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/api/actions/indices/flush.rb', line 22 def flush(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.__listify(_index)}/_flush" else "_flush" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#flush_synced(arguments = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/elasticsearch/api/actions/indices/flush_synced.rb', line 20 def flush_synced(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.__listify(_index)}/_flush/synced" else "_flush/synced" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { perform_request(method, path, params, body).body } else perform_request(method, path, params, body).body end end |
#forcemerge(arguments = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/elasticsearch/api/actions/indices/forcemerge.rb', line 24 def forcemerge(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.__listify(_index)}/_forcemerge" else "_forcemerge" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#freeze(arguments = {}) ⇒ Object
This feature is available in the Platinum distribution of Elasticsearch.
In order to keep indices available and queryable for a longer period but at the same time reduce their
hardware requirements they can be transitioned into a frozen state. Once an index is frozen, all of its
transient shard memory (aside from mappings and analyzers) is moved to persistent storage.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/freeze.rb', line 15 def freeze(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] valid_params = [ :timeout, :master_timeout, :ignore_unavailable, :allow_no_indices, :expand_wildcards, :wait_for_active_shards ] arguments = arguments.clone index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = Elasticsearch::API::Utils.__pathify Elasticsearch::API::Utils.__listify(index), '_freeze' params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params perform_request(method, path, params).body end |
#get(arguments = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/elasticsearch/api/actions/indices/get.rb', line 26 def get(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = "#{Utils.__listify(_index)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#get_alias(arguments = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/elasticsearch/api/actions/indices/get_alias.rb', line 23 def get_alias(arguments = {}) arguments = arguments.clone _name = arguments.delete(:name) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index && _name "#{Utils.__listify(_index)}/_alias/#{Utils.__listify(_name)}" elsif _index "#{Utils.__listify(_index)}/_alias" elsif _name "_alias/#{Utils.__listify(_name)}" else "_alias" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#get_field_mapping(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/elasticsearch/api/actions/indices/get_field_mapping.rb', line 31 def get_field_mapping(arguments = {}) _fields = arguments.delete(:field) || arguments.delete(:fields) raise ArgumentError, "Required argument 'field' missing" unless _fields arguments = arguments.clone _index = arguments.delete(:index) _type = arguments.delete(:type) method = Elasticsearch::API::HTTP_GET path = if _index && _type && _fields "#{Utils.__listify(_index)}/_mapping/#{Utils.__listify(_type)}/field/#{Utils.__listify(_fields)}" elsif _index && _fields "#{Utils.__listify(_index)}/_mapping/field/#{Utils.__listify(_fields)}" elsif _type && _fields "_mapping/#{Utils.__listify(_type)}/field/#{Utils.__listify(_fields)}" else "_mapping/field/#{Utils.__listify(_fields)}" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#get_mapping(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/elasticsearch/api/actions/indices/get_mapping.rb', line 30 def get_mapping(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) _type = arguments.delete(:type) method = Elasticsearch::API::HTTP_GET path = if _index && _type "#{Utils.__listify(_index)}/_mapping/#{Utils.__listify(_type)}" elsif _index "#{Utils.__listify(_index)}/_mapping" elsif _type "_mapping/#{Utils.__listify(_type)}" else "_mapping" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#get_settings(arguments = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/elasticsearch/api/actions/indices/get_settings.rb', line 26 def get_settings(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_GET path = if _index && _name "#{Utils.__listify(_index)}/_settings/#{Utils.__listify(_name)}" elsif _index "#{Utils.__listify(_index)}/_settings" elsif _name "_settings/#{Utils.__listify(_name)}" else "_settings" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#get_template(arguments = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/get_template.rb', line 20 def get_template(arguments = {}) arguments = arguments.clone _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_GET path = if _name "_template/#{Utils.__listify(_name)}" else "_template" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#get_upgrade(arguments = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/get_upgrade.rb', line 20 def get_upgrade(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index "#{Utils.__listify(_index)}/_upgrade" else "_upgrade" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#open(arguments = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/api/actions/indices/open.rb', line 24 def open(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "#{Utils.__listify(_index)}/_open" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#put_alias(arguments = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/elasticsearch/api/actions/indices/put_alias.rb', line 20 def put_alias(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone _index = arguments.delete(:index) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT path = if _index && _name "#{Utils.__listify(_index)}/_aliases/#{Utils.__listify(_name)}" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#put_mapping(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/elasticsearch/api/actions/indices/put_mapping.rb', line 30 def put_mapping(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone _index = arguments.delete(:index) _type = arguments.delete(:type) method = Elasticsearch::API::HTTP_PUT path = if _index && _type "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_mappings" elsif _index "#{Utils.__listify(_index)}/_mapping" elsif _type "_mappings/#{Utils.__listify(_type)}" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#put_settings(arguments = {}) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/elasticsearch/api/actions/indices/put_settings.rb', line 26 def put_settings(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_PUT path = if _index "#{Utils.__listify(_index)}/_settings" else "_settings" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#put_template(arguments = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/put_template.rb', line 21 def put_template(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'name' missing" unless arguments[:name] arguments = arguments.clone _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT path = "_template/#{Utils.__listify(_name)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#recovery(arguments = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/elasticsearch/api/actions/indices/recovery.rb', line 18 def recovery(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index "#{Utils.__listify(_index)}/_recovery" else "_recovery" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#refresh(arguments = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/refresh.rb', line 20 def refresh(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.__listify(_index)}/_refresh" else "_refresh" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#rollover(arguments = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/elasticsearch/api/actions/indices/rollover.rb', line 24 def rollover(arguments = {}) raise ArgumentError, "Required argument 'alias' missing" unless arguments[:alias] arguments = arguments.clone _alias = arguments.delete(:alias) _new_index = arguments.delete(:new_index) method = Elasticsearch::API::HTTP_POST path = if _alias && _new_index "#{Utils.__listify(_alias)}/_rollover/#{Utils.__listify(_new_index)}" else "#{Utils.__listify(_alias)}/_rollover" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#segments(arguments = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/elasticsearch/api/actions/indices/segments.rb', line 22 def segments(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index "#{Utils.__listify(_index)}/_segments" else "_segments" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#shard_stores(arguments = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/elasticsearch/api/actions/indices/shard_stores.rb', line 23 def shard_stores(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index "#{Utils.__listify(_index)}/_shard_stores" else "_shard_stores" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#shrink(arguments = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/elasticsearch/api/actions/indices/shrink.rb', line 22 def shrink(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'target' missing" unless arguments[:target] arguments = arguments.clone _index = arguments.delete(:index) _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_PUT path = "#{Utils.__listify(_index)}/_shrink/#{Utils.__listify(_target)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#split(arguments = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/elasticsearch/api/actions/indices/split.rb', line 22 def split(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'target' missing" unless arguments[:target] arguments = arguments.clone _index = arguments.delete(:index) _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_PUT path = "#{Utils.__listify(_index)}/_split/#{Utils.__listify(_target)}" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#stats(arguments = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/elasticsearch/api/actions/indices/stats.rb', line 33 def stats(arguments = {}) method = HTTP_GET parts = Utils.__extract_parts arguments, ParamsRegistry.get(:stats_parts) path = Utils.__pathify Utils.__listify(arguments[:index]), '_stats', Utils.__listify(parts) params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(:stats_params) params[:fields] = Utils.__listify(params[:fields], :escape => false) if params[:fields] params[:groups] = Utils.__listify(params[:groups], :escape => false) if params[:groups] body = nil perform_request(method, path, params, body).body end |
#unfreeze(arguments = {}) ⇒ Object
This feature is available in the Platinum distribution of Elasticsearch.
In order to keep indices available and queryable for a longer period but at the same time reduce their
hardware requirements they can be transitioned into a frozen state. Once an index is frozen, all of its
transient shard memory (aside from mappings and analyzers) is moved to persistent storage.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/elasticsearch/api/actions/indices/unfreeze.rb', line 15 def unfreeze(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] valid_params = [ :timeout, :master_timeout, :ignore_unavailable, :allow_no_indices, :expand_wildcards, :wait_for_active_shards ] arguments = arguments.clone index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = Elasticsearch::API::Utils.__pathify Elasticsearch::API::Utils.__listify(index), '_unfreeze' params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, valid_params perform_request(method, path, params).body end |
#update_aliases(arguments = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/elasticsearch/api/actions/indices/update_aliases.rb', line 18 def update_aliases(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone method = Elasticsearch::API::HTTP_POST path = "_aliases" params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |
#upgrade(arguments = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/elasticsearch/api/actions/indices/upgrade.rb', line 23 def upgrade(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.__listify(_index)}/_upgrade" else "_upgrade" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body).body end |
#validate_query(arguments = {}) ⇒ Object
*Deprecation notice*: Specifying types in urls has been deprecated Deprecated since version 7.0.0
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/elasticsearch/api/actions/indices/validate_query.rb', line 39 def validate_query(arguments = {}) arguments = arguments.clone _index = arguments.delete(:index) _type = arguments.delete(:type) method = Elasticsearch::API::HTTP_GET path = if _index && _type "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/_validate/query" elsif _index "#{Utils.__listify(_index)}/_validate/query" else "_validate/query" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body).body end |