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/shrink.rb,
lib/elasticsearch/api/actions/indices/analyze.rb,
lib/elasticsearch/api/actions/indices/refresh.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/add_block.rb,
lib/elasticsearch/api/actions/indices/get_alias.rb,
lib/elasticsearch/api/actions/indices/put_alias.rb,
lib/elasticsearch/api/actions/indices/disk_usage.rb,
lib/elasticsearch/api/actions/indices/downsample.rb,
lib/elasticsearch/api/actions/indices/forcemerge.rb,
lib/elasticsearch/api/actions/indices/clear_cache.rb,
lib/elasticsearch/api/actions/indices/create_from.rb,
lib/elasticsearch/api/actions/indices/get_mapping.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/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/resolve_index.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/get_data_stream.rb,
lib/elasticsearch/api/actions/indices/migrate_reindex.rb,
lib/elasticsearch/api/actions/indices/resolve_cluster.rb,
lib/elasticsearch/api/actions/indices/field_usage_stats.rb,
lib/elasticsearch/api/actions/indices/get_field_mapping.rb,
lib/elasticsearch/api/actions/indices/simulate_template.rb,
lib/elasticsearch/api/actions/indices/create_data_stream.rb,
lib/elasticsearch/api/actions/indices/data_streams_stats.rb,
lib/elasticsearch/api/actions/indices/delete_data_stream.rb,
lib/elasticsearch/api/actions/indices/get_data_lifecycle.rb,
lib/elasticsearch/api/actions/indices/get_index_template.rb,
lib/elasticsearch/api/actions/indices/modify_data_stream.rb,
lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb,
lib/elasticsearch/api/actions/indices/put_index_template.rb,
lib/elasticsearch/api/actions/indices/promote_data_stream.rb,
lib/elasticsearch/api/actions/indices/delete_data_lifecycle.rb,
lib/elasticsearch/api/actions/indices/delete_index_template.rb,
lib/elasticsearch/api/actions/indices/exists_index_template.rb,
lib/elasticsearch/api/actions/indices/cancel_migrate_reindex.rb,
lib/elasticsearch/api/actions/indices/explain_data_lifecycle.rb,
lib/elasticsearch/api/actions/indices/migrate_to_data_stream.rb,
lib/elasticsearch/api/actions/indices/get_data_stream_options.rb,
lib/elasticsearch/api/actions/indices/put_data_stream_options.rb,
lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb,
lib/elasticsearch/api/actions/indices/simulate_index_template.rb,
lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb,
lib/elasticsearch/api/actions/indices/get_data_stream_settings.rb,
lib/elasticsearch/api/actions/indices/put_data_stream_settings.rb,
lib/elasticsearch/api/actions/indices/delete_data_stream_options.rb,
lib/elasticsearch/api/actions/indices/get_migrate_reindex_status.rb

Instance Method Summary collapse

Instance Method Details

#add_block(arguments = {}) ⇒ Object

Add an index block

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma separated list of indices to add a block to

  • :block (String)

    The block to add (one of read, write, read_only or metadata)

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/elasticsearch/api/actions/indices/add_block.rb', line 38

def add_block(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.add_block' }

  defined_params = %i[index block].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'block' missing" unless arguments[:block]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  _block = arguments.delete(:block)

  method = Elasticsearch::API::HTTP_PUT
  path   = "#{Utils.__listify(_index)}/_block/#{Utils.__listify(_block)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#analyze(arguments = {}) ⇒ Object

Get tokens from text analysis

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the index to scope the operation

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Define analyzer/tokenizer parameters and the text on which the analysis should be performed (Required)

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/analyze.rb', line 33

def analyze(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.analyze' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = if _index
             "#{Utils.__listify(_index)}/_analyze"
           else
             '_analyze'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#cancel_migrate_reindex(arguments = {}) ⇒ Object

Cancel a migration reindex operation

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The index or data stream name

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/elasticsearch/api/actions/indices/cancel_migrate_reindex.rb', line 32

def cancel_migrate_reindex(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.cancel_migrate_reindex' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "_migration/reindex/#{Utils.__listify(_index)}/_cancel"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#clear_cache(arguments = {}) ⇒ Object

Clear the cache

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index name to limit the operation

  • :fielddata (Boolean)

    Clear field data

  • :fields (List)

    A comma-separated list of fields to clear when using the ‘fielddata` parameter (default: all)

  • :query (Boolean)

    Clear query caches

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :request (Boolean)

    Clear request cache

  • :headers (Hash)

    Custom HTTP headers

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/elasticsearch/api/actions/indices/clear_cache.rb', line 39

def clear_cache(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.clear_cache' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = if _index
             "#{Utils.__listify(_index)}/_cache/clear"
           else
             '_cache/clear'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#clone(arguments = {}) ⇒ Object

Clone an index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the source index to clone

  • :target (String)

    The name of the target index to clone into

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :wait_for_active_shards (String)

    Set the number of active shards to wait for on the cloned index before the operation returns.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The configuration for the target index (‘settings` and `aliases`)

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/elasticsearch/api/actions/indices/clone.rb', line 37

def clone(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.clone' }

  defined_params = %i[index target].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'target' missing" unless arguments[:target]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  _target = arguments.delete(:target)

  method = Elasticsearch::API::HTTP_PUT
  path   = "#{Utils.__listify(_index)}/_clone/#{Utils.__listify(_target)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#close(arguments = {}) ⇒ Object

Close an index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma separated list of indices to close

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :wait_for_active_shards (String)

    Sets the number of active shards to wait for before the operation returns.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/close.rb', line 38

def close(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.close' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Utils.__listify(_index)}/_close"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#create(arguments = {}) ⇒ Object

Create an index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the index

  • :wait_for_active_shards (String)

    Set the number of active shards to wait for before the operation returns.

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The configuration for the index (‘settings` and `mappings`)

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/elasticsearch/api/actions/indices/create.rb', line 36

def create(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.create' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_PUT
  path   = "#{Utils.__listify(_index)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#create_data_stream(arguments = {}) ⇒ Object

Create a data stream

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the data stream

  • :timeout (Time)

    Specify timeout for acknowledging the cluster state update

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
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/create_data_stream.rb', line 34

def create_data_stream(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.create_data_stream' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_data_stream/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#create_from(arguments = {}) ⇒ Object

Create an index from a source index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :source (String)

    The source index name

  • :dest (String)

    The destination index name

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The body contains the fields ‘mappings_override`, `settings_override`, and `remove_index_blocks`.

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/create_from.rb', line 34

def create_from(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.create_from' }

  defined_params = %i[source dest].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'source' missing" unless arguments[:source]
  raise ArgumentError, "Required argument 'dest' missing" unless arguments[:dest]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _source = arguments.delete(:source)

  _dest = arguments.delete(:dest)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_create_from/#{Utils.__listify(_source)}/#{Utils.__listify(_dest)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#data_streams_stats(arguments = {}) ⇒ Object

Get data stream stats

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data stream names; use ‘_all` or empty string to perform the operation on all data streams

  • :headers (Hash)

    Custom HTTP headers

See Also:



32
33
34
35
36
37
38
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/data_streams_stats.rb', line 32

def data_streams_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.data_streams_stats' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_data_stream/#{Utils.__listify(_name)}/_stats"
           else
             '_data_stream/_stats'
           end
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#delete(arguments = {}) ⇒ Object

Delete indices

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of indices to delete; use ‘_all` or `*` string to delete all indices

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Ignore unavailable indexes (default: false)

  • :allow_no_indices (Boolean)

    Ignore if a wildcard expression resolves to no concrete indices (default: false)

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open, closed, or hidden indices (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/indices/delete.rb', line 37

def delete(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.delete' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "#{Utils.__listify(_index)}"
  params = Utils.process_params(arguments)

  if Array(arguments[:ignore]).include?(404)
    Utils.__rescue_from_not_found do
      Elasticsearch::API::Response.new(
        perform_request(method, path, params, body, headers, request_opts)
      )
    end
  else
    Elasticsearch::API::Response.new(
      perform_request(method, path, params, body, headers, request_opts)
    )
  end
end

#delete_alias(arguments = {}) ⇒ Object

Delete an alias

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names (supports wildcards); use ‘_all` for all indices

  • :name (List)

    A comma-separated list of aliases to delete (supports wildcards); use ‘_all` to delete all aliases for the specified indices.

  • :timeout (Time)

    Explicit timestamp for the document

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/delete_alias.rb', line 35

def delete_alias(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_alias' }

  defined_params = %i[index name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = ("#{Utils.__listify(_index)}/_aliases/#{Utils.__listify(_name)}" if _index && _name)
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#delete_data_lifecycle(arguments = {}) ⇒ Object

Delete data stream lifecycles

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams of which the data stream lifecycle will be deleted; use ‘*` to get all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :timeout (Time)

    Explicit timestamp for the document

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/indices/delete_data_lifecycle.rb', line 35

def delete_data_lifecycle(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_data_lifecycle' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_data_stream/#{Utils.__listify(_name)}/_lifecycle"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#delete_data_stream(arguments = {}) ⇒ Object

Delete data streams

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams to delete; use ‘*` to delete all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
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/delete_data_stream.rb', line 34

def delete_data_stream(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_data_stream' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_data_stream/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#delete_data_stream_options(arguments = {}) ⇒ Object

Deletes the data stream options of the selected data streams

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams of which the data stream options will be deleted; use ‘*` to get all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :timeout (Time)

    Explicit timestamp for the document

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/indices/delete_data_stream_options.rb', line 35

def delete_data_stream_options(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_data_stream_options' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_data_stream/#{Utils.__listify(_name)}/_options"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#delete_index_template(arguments = {}) ⇒ Object

Delete an index template

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the template

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
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/delete_index_template.rb', line 34

def delete_index_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_index_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_index_template/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#delete_template(arguments = {}) ⇒ Object

Delete a legacy index template

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the template

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/elasticsearch/api/actions/indices/delete_template.rb', line 34

def delete_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_template/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  if Array(arguments[:ignore]).include?(404)
    Utils.__rescue_from_not_found do
      Elasticsearch::API::Response.new(
        perform_request(method, path, params, body, headers, request_opts)
      )
    end
  else
    Elasticsearch::API::Response.new(
      perform_request(method, path, params, body, headers, request_opts)
    )
  end
end

#disk_usage(arguments = {}) ⇒ Object

Analyze the index disk usage This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    Comma-separated list of indices or data streams to analyze the disk usage

  • :run_expensive_tasks (Boolean)

    Must be set to [true] in order for the task to be performed. Defaults to false.

  • :flush (Boolean)

    Whether flush or not before analyzing the index disk usage. Defaults to true

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/elasticsearch/api/actions/indices/disk_usage.rb', line 41

def disk_usage(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.disk_usage' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Utils.__listify(_index)}/_disk_usage"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#downsample(arguments = {}) ⇒ Object

Downsample an index This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The index to downsample (Required)

  • :target_index (String)

    The name of the target index to store downsampled data (Required)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The downsampling configuration (Required)

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/elasticsearch/api/actions/indices/downsample.rb', line 38

def downsample(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.downsample' }

  defined_params = %i[index target_index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'target_index' missing" unless arguments[:target_index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  _target_index = arguments.delete(:target_index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Utils.__listify(_index)}/_downsample/#{Utils.__listify(_target_index)}"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#exists(arguments = {}) ⇒ Object Also known as: exists?

Check indices

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :ignore_unavailable (Boolean)

    Ignore unavailable indexes (default: false)

  • :allow_no_indices (Boolean)

    Ignore if a wildcard expression resolves to no concrete indices (default: false)

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :include_defaults (Boolean)

    Whether to return all default setting for each of the indices.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/exists.rb', line 38

def exists(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.exists' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_HEAD
  path   = "#{Utils.__listify(_index)}"
  params = Utils.process_params(arguments)

  Utils.__rescue_from_not_found do
    perform_request(method, path, params, body, headers, request_opts).status == 200
  end
end

#exists_alias(arguments = {}) ⇒ Object Also known as: exists_alias?

Check aliases

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of alias names to return

  • :index (List)

    A comma-separated list of index names to filter aliases

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/elasticsearch/api/actions/indices/exists_alias.rb', line 37

def exists_alias(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.exists_alias' }

  defined_params = %i[name index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _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.process_params(arguments)

  Utils.__rescue_from_not_found do
    perform_request(method, path, params, body, headers, request_opts).status == 200
  end
end

#exists_index_template(arguments = {}) ⇒ Object Also known as: exists_index_template?

Check index templates

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the template

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/indices/exists_index_template.rb', line 35

def exists_index_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.exists_index_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_HEAD
  path   = "_index_template/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#exists_template(arguments = {}) ⇒ Object Also known as: exists_template?

Check existence of index templates

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    The comma separated names of the index templates

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/indices/exists_template.rb', line 35

def exists_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.exists_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_HEAD
  path   = "_template/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Utils.__rescue_from_not_found do
    perform_request(method, path, params, body, headers, request_opts).status == 200
  end
end

#explain_data_lifecycle(arguments = {}) ⇒ Object

Get the status for a data stream lifecycle

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the index to explain

  • :include_defaults (Boolean)

    indicates if the API should return the default values the system uses for the index’s lifecycle

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
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/explain_data_lifecycle.rb', line 34

def explain_data_lifecycle(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.explain_data_lifecycle' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = "#{Utils.__listify(_index)}/_lifecycle/explain"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#field_usage_stats(arguments = {}) ⇒ Object

Get field usage stats This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :fields (List)

    A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards)

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/elasticsearch/api/actions/indices/field_usage_stats.rb', line 40

def field_usage_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.field_usage_stats' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = "#{Utils.__listify(_index)}/_field_usage_stats"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#flush(arguments = {}) ⇒ Object

Flush data streams or indices

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string for all indices

  • :force (Boolean)

    Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal)

  • :wait_if_ongoing (Boolean)

    If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running.

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/indices/flush.rb', line 37

def flush(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.flush' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = if _index
             "#{Utils.__listify(_index)}/_flush"
           else
             '_flush'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#forcemerge(arguments = {}) ⇒ Object

Force a merge

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :flush (Boolean)

    Specify whether the index should be flushed after performing the operation (default: true)

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :max_num_segments (Long)

    The number of segments the index should be merged into (default: dynamic)

  • :only_expunge_deletes (Boolean)

    Specify whether the operation should only expunge deleted documents

  • :wait_for_completion (Boolean)

    Should the request wait until the force merge is completed.

  • :headers (Hash)

    Custom HTTP headers

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/elasticsearch/api/actions/indices/forcemerge.rb', line 39

def forcemerge(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.forcemerge' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = if _index
             "#{Utils.__listify(_index)}/_forcemerge"
           else
             '_forcemerge'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get(arguments = {}) ⇒ Object

Get index information

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :ignore_unavailable (Boolean)

    Ignore unavailable indexes (default: false)

  • :allow_no_indices (Boolean)

    Ignore if a wildcard expression resolves to no concrete indices (default: false)

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :features (String)

    Return only information on specified index features (options: aliases, mappings, settings)

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :include_defaults (Boolean)

    Whether to return all default setting for each of the indices.

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/elasticsearch/api/actions/indices/get.rb', line 40

def get(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = "#{Utils.__listify(_index)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_alias(arguments = {}) ⇒ Object

Get aliases

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of alias names to return

  • :index (List)

    A comma-separated list of index names to filter aliases

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :headers (Hash)

    Custom HTTP headers

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/indices/get_alias.rb', line 37

def get_alias(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_alias' }

  defined_params = %i[name index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _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.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_data_lifecycle(arguments = {}) ⇒ Object

Get data stream lifecycles

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams to get; use ‘*` to get all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :include_defaults (Boolean)

    Return all relevant default configurations for the data stream (default: false)

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/indices/get_data_lifecycle.rb', line 35

def get_data_lifecycle(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_lifecycle' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = "_data_stream/#{Utils.__listify(_name)}/_lifecycle"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_data_lifecycle_stats(arguments = {}) ⇒ Object

Get data stream lifecycle stats

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

See Also:



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb', line 31

def get_data_lifecycle_stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_lifecycle_stats' }

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  method = Elasticsearch::API::HTTP_GET
  path   = '_lifecycle/stats'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_data_stream(arguments = {}) ⇒ Object

Get data streams

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams to get; use ‘*` to get all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :include_defaults (Boolean)

    Return all relevant default configurations for the data stream (default: false)

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :verbose (Boolean)

    Whether the maximum timestamp for each data stream should be calculated and returned (default: false)

  • :headers (Hash)

    Custom HTTP headers

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/get_data_stream.rb', line 36

def get_data_stream(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_data_stream/#{Utils.__listify(_name)}"
           else
             '_data_stream'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_data_stream_options(arguments = {}) ⇒ Object

Returns the data stream options of the selected data streams

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams to get; use ‘*` to get all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
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/get_data_stream_options.rb', line 34

def get_data_stream_options(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream_options' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = "_data_stream/#{Utils.__listify(_name)}/_options"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_data_stream_settings(arguments = {}) ⇒ Object

Gets a data stream’s settings

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    Comma-separated list of data streams or data stream patterns

  • :master_timeout (Time)

    Period to wait for a connection to the master node

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/elasticsearch/api/actions/indices/get_data_stream_settings.rb', line 33

def get_data_stream_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream_settings' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = "_data_stream/#{Utils.__listify(_name)}/_settings"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_field_mapping(arguments = {}) ⇒ Object

Get mapping definitions

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :fields (List)

    A comma-separated list of fields

  • :index (List)

    A comma-separated list of index names

  • :include_defaults (Boolean)

    Whether the default mapping values should be returned as well

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/elasticsearch/api/actions/indices/get_field_mapping.rb', line 38

def get_field_mapping(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_field_mapping' }

  defined_params = %i[fields index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  _fields = arguments.delete(:field) || arguments.delete(:fields)
  raise ArgumentError, "Required argument 'field' missing" unless _fields

  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index && _fields
             "#{Utils.__listify(_index)}/_mapping/field/#{Utils.__listify(_fields)}"
           else
             "_mapping/field/#{Utils.__listify(_fields)}"
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_index_template(arguments = {}) ⇒ Object

Get index templates

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    A pattern that returned template names must match

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :include_defaults (Boolean)

    Return all relevant default configurations for the index template (default: false)

  • :headers (Hash)

    Custom HTTP headers

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/get_index_template.rb', line 36

def get_index_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_index_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_index_template/#{Utils.__listify(_name)}"
           else
             '_index_template'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_mapping(arguments = {}) ⇒ Object

Get mapping definitions

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false) Deprecated

  • :headers (Hash)

    Custom HTTP headers

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/indices/get_mapping.rb', line 37

def get_mapping(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_mapping' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index
             "#{Utils.__listify(_index)}/_mapping"
           else
             '_mapping'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_migrate_reindex_status(arguments = {}) ⇒ Object

Get the migration reindexing status

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The index or data stream name

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/elasticsearch/api/actions/indices/get_migrate_reindex_status.rb', line 32

def get_migrate_reindex_status(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_migrate_reindex_status' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = "_migration/reindex/#{Utils.__listify(_index)}/_status"
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_settings(arguments = {}) ⇒ Object

Get index settings

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :name (List)

    The name of the settings that should be included

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :include_defaults (Boolean)

    Whether to return all default setting for each of the indices.

  • :headers (Hash)

    Custom HTTP headers

See Also:



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/elasticsearch/api/actions/indices/get_settings.rb', line 40

def get_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_settings' }

  defined_params = %i[index name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _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.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#get_template(arguments = {}) ⇒ Object

Get legacy index templates

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    The comma separated names of the index templates

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :master_timeout (Time)

    Explicit operation timeout for connection to master node

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :headers (Hash)

    Custom HTTP headers

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/get_template.rb', line 35

def get_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.get_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_template/#{Utils.__listify(_name)}"
           else
             '_template'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#migrate_reindex(arguments = {}) ⇒ Object

Reindex legacy backing indices

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The body contains the fields ‘mode` and `source.index, where the only mode currently supported is `upgrade`, and the `source.index` must be a data stream name (Required)

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/indices/migrate_reindex.rb', line 32

def migrate_reindex(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.migrate_reindex' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_migration/reindex'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#migrate_to_data_stream(arguments = {}) ⇒ Object

Convert an index alias to a data stream

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the alias to migrate

  • :timeout (Time)

    Specify timeout for acknowledging the cluster state update

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
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/migrate_to_data_stream.rb', line 34

def migrate_to_data_stream(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.migrate_to_data_stream' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_data_stream/_migrate/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#modify_data_stream(arguments = {}) ⇒ Object

Update data streams

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data stream modifications (Required)

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/indices/modify_data_stream.rb', line 32

def modify_data_stream(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.modify_data_stream' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_data_stream/_modify'
  params = {}

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#open(arguments = {}) ⇒ Object

Open a closed index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma separated list of indices to open

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :wait_for_active_shards (String)

    Sets the number of active shards to wait for before the operation returns.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/open.rb', line 38

def open(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.open' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Utils.__listify(_index)}/_open"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#promote_data_stream(arguments = {}) ⇒ Object

Promote a data stream

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the data stream

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/elasticsearch/api/actions/indices/promote_data_stream.rb', line 33

def promote_data_stream(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.promote_data_stream' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_data_stream/_promote/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_alias(arguments = {}) ⇒ Object

Create or update an alias

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names the alias should point to (supports wildcards); use ‘_all` to perform the operation on all indices.

  • :name (String)

    The name of the alias to be created or updated

  • :timeout (Time)

    Explicit timestamp for the document

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The settings for the alias, such as ‘routing` or `filter`

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/indices/put_alias.rb', line 36

def put_alias(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_alias' }

  defined_params = %i[index name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = ("#{Utils.__listify(_index)}/_aliases/#{Utils.__listify(_name)}" if _index && _name)
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_data_lifecycle(arguments = {}) ⇒ Object

Update data stream lifecycles

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams whose lifecycle will be updated; use ‘*` to set the lifecycle to all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :timeout (Time)

    Explicit timestamp for the document

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data stream lifecycle configuration that consist of the data retention (Required)

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb', line 36

def put_data_lifecycle(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_lifecycle' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_data_stream/#{Utils.__listify(_name)}/_lifecycle"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_data_stream_options(arguments = {}) ⇒ Object

Updates the data stream options of the selected data streams

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of data streams whose options will be updated; use ‘*` to set the options to all data streams

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :timeout (Time)

    Explicit timestamp for the document

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data stream options configuration that consist of the failure store configuration (Required)

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/put_data_stream_options.rb', line 36

def put_data_stream_options(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_stream_options' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_data_stream/#{Utils.__listify(_name)}/_options"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_data_stream_settings(arguments = {}) ⇒ Object

Updates a data stream’s settings

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    Comma-separated list of data streams or data stream patterns

  • :dry_run (Boolean)

    Whether this request should only be a dry run rather than actually applying settings

  • :timeout (Time)

    Period to wait for a response

  • :master_timeout (Time)

    Period to wait for a connection to the master node

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The data stream settings to be updated (Required)

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/put_data_stream_settings.rb', line 36

def put_data_stream_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_stream_settings' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_data_stream/#{Utils.__listify(_name)}/_settings"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_index_template(arguments = {}) ⇒ Object

Create or update an index template

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the template

  • :create (Boolean)

    Whether the index template should only be added if new or can also replace an existing one

  • :cause (String)

    User defined reason for creating/updating the index template

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The template definition (Required)

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/put_index_template.rb', line 36

def put_index_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_index_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_index_template/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_mapping(arguments = {}) ⇒ Object

Update field mappings

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names the mapping should be added to (supports wildcards); use ‘_all` or omit to add the mapping on all indices.

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :write_index_only (Boolean)

    When true, applies mappings only to the write index of an alias or data stream

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The mapping definition (Required)

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/elasticsearch/api/actions/indices/put_mapping.rb', line 39

def put_mapping(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_mapping' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_PUT
  path   = "#{Utils.__listify(_index)}/_mapping"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_settings(arguments = {}) ⇒ Object

Update index settings

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :timeout (Time)

    Explicit operation timeout

  • :preserve_existing (Boolean)

    Whether to update existing settings. If set to ‘true` existing settings on an index remain unchanged, the default is `false`

  • :reopen (Boolean)

    Whether to close and reopen the index to apply non-dynamic settings. If set to ‘true` the indices to which the settings are being applied will be closed temporarily and then reopened in order to apply the changes. The default is `false`

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The index settings to be updated (Required)

Raises:

  • (ArgumentError)

See Also:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/indices/put_settings.rb', line 41

def put_settings(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_settings' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_PUT
  path   = if _index
             "#{Utils.__listify(_index)}/_settings"
           else
             '_settings'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#put_template(arguments = {}) ⇒ Object

Create or update a legacy index template

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the template

  • :order (Integer)

    The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers)

  • :create (Boolean)

    Whether the index template should only be added if new or can also replace an existing one

  • :cause (String)

    User defined reason for creating/updating the index template

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The template definition (Required)

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/put_template.rb', line 37

def put_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.put_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_template/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#recovery(arguments = {}) ⇒ Object

Get index recovery information

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :detailed (Boolean)

    Whether to display detailed information about shard recovery

  • :active_only (Boolean)

    Display only those recoveries that are currently on-going

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/indices/recovery.rb', line 37

def recovery(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.recovery' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index
             "#{Utils.__listify(_index)}/_recovery"
           else
             '_recovery'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#refresh(arguments = {}) ⇒ Object

Refresh an index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/refresh.rb', line 35

def refresh(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.refresh' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = if _index
             "#{Utils.__listify(_index)}/_refresh"
           else
             '_refresh'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#reload_search_analyzers(arguments = {}) ⇒ Object

Reload search analyzers

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to reload analyzers for

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :resource (String)

    changed resource to reload analyzers from if applicable

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb', line 36

def reload_search_analyzers(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.reload_search_analyzers' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = "#{Utils.__listify(_index)}/_reload_search_analyzers"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#resolve_cluster(arguments = {}) ⇒ Object

Resolve the cluster

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of cluster:index names or wildcard expressions

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed). Only allowed when providing an index expression.

  • :ignore_throttled (Boolean)

    Whether specified concrete, expanded or aliased indices should be ignored when throttled. Only allowed when providing an index expression.

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified). Only allowed when providing an index expression.

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open). Only allowed when providing an index expression. (options: open, closed, hidden, none, all)

  • :timeout (Time)

    The maximum time to wait for remote clusters to respond

  • :headers (Hash)

    Custom HTTP headers

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/indices/resolve_cluster.rb', line 37

def resolve_cluster(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.resolve_cluster' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_resolve/cluster/#{Utils.__listify(_name)}"
           else
             '_resolve/cluster'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#resolve_index(arguments = {}) ⇒ Object

Resolve indices

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of names or wildcard expressions

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/elasticsearch/api/actions/indices/resolve_index.rb', line 35

def resolve_index(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.resolve_index' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = "_resolve/index/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#rollover(arguments = {}) ⇒ Object

Roll over to a new index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :alias (String)

    The name of the alias to rollover

  • :new_index (String)

    The name of the rollover index

  • :timeout (Time)

    Explicit operation timeout

  • :dry_run (Boolean)

    If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :wait_for_active_shards (String)

    Set the number of active shards to wait for on the newly created rollover index before the operation returns.

  • :lazy (Boolean)

    If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write. Only allowed on data streams.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The conditions that needs to be met for executing rollover

Raises:

  • (ArgumentError)

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/elasticsearch/api/actions/indices/rollover.rb', line 39

def rollover(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.rollover' }

  defined_params = %i[alias new_index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'alias' missing" unless arguments[:alias]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _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.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#segments(arguments = {}) ⇒ Object

Get index segments

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :verbose (Boolean)

    Includes detailed memory usage by Lucene. Deprecated

  • :headers (Hash)

    Custom HTTP headers

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/segments.rb', line 36

def segments(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.segments' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index
             "#{Utils.__listify(_index)}/_segments"
           else
             '_segments'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#shard_stores(arguments = {}) ⇒ Object

Get index shard stores

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :status (List)

    A comma-separated list of statuses used to filter on shards to get store information for (options: green, yellow, red, all)

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :headers (Hash)

    Custom HTTP headers

See Also:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/elasticsearch/api/actions/indices/shard_stores.rb', line 36

def shard_stores(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.shard_stores' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index
             "#{Utils.__listify(_index)}/_shard_stores"
           else
             '_shard_stores'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#shrink(arguments = {}) ⇒ Object

Shrink an index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the source index to shrink

  • :target (String)

    The name of the target index to shrink into

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :wait_for_active_shards (String)

    Set the number of active shards to wait for on the shrunken index before the operation returns.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The configuration for the target index (‘settings` and `aliases`) (Required)

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/elasticsearch/api/actions/indices/shrink.rb', line 37

def shrink(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.shrink' }

  defined_params = %i[index target].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'target' missing" unless arguments[:target]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  _target = arguments.delete(:target)

  method = Elasticsearch::API::HTTP_PUT
  path   = "#{Utils.__listify(_index)}/_shrink/#{Utils.__listify(_target)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#simulate_index_template(arguments = {}) ⇒ Object

Simulate an index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the index (it must be a concrete index name)

  • :create (Boolean)

    Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one

  • :cause (String)

    User defined reason for dry-run creating the new template for simulation purposes

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :include_defaults (Boolean)

    Return all relevant default configurations for this index template simulation (default: false)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    New index template definition, which will be included in the simulation, as if it already exists in the system

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/elasticsearch/api/actions/indices/simulate_index_template.rb', line 37

def simulate_index_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.simulate_index_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = "_index_template/_simulate_index/#{Utils.__listify(_name)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#simulate_template(arguments = {}) ⇒ Object

Simulate an index template

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :name (String)

    The name of the index template

  • :create (Boolean)

    Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one

  • :cause (String)

    User defined reason for dry-run creating the new template for simulation purposes

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :include_defaults (Boolean)

    Return all relevant default configurations for this template simulation (default: false)

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    New index template definition to be simulated, if no index template name is specified

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/elasticsearch/api/actions/indices/simulate_template.rb', line 37

def simulate_template(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.simulate_template' }

  defined_params = [:name].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_POST
  path   = if _name
             "_index_template/_simulate/#{Utils.__listify(_name)}"
           else
             '_index_template/_simulate'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#split(arguments = {}) ⇒ Object

Split an index

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the source index to split

  • :target (String)

    The name of the target index to split into

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :wait_for_active_shards (String)

    Set the number of active shards to wait for on the shrunken index before the operation returns.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The configuration for the target index (‘settings` and `aliases`) (Required)

Raises:

  • (ArgumentError)

See Also:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/elasticsearch/api/actions/indices/split.rb', line 37

def split(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.split' }

  defined_params = %i[index target].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
  raise ArgumentError, "Required argument 'target' missing" unless arguments[:target]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  _index = arguments.delete(:index)

  _target = arguments.delete(:target)

  method = Elasticsearch::API::HTTP_PUT
  path   = "#{Utils.__listify(_index)}/_split/#{Utils.__listify(_target)}"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#stats(arguments = {}) ⇒ Object

Get index statistics

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :metric (List)

    Limit the information returned the specific metrics. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, bulk)

  • :index (List)

    A comma-separated list of index names; use ‘_all` or empty string to perform the operation on all indices

  • :completion_fields (List)

    A comma-separated list of fields for the ‘completion` index metric (supports wildcards)

  • :fielddata_fields (List)

    A comma-separated list of fields for the ‘fielddata` index metric (supports wildcards)

  • :fields (List)

    A comma-separated list of fields for ‘fielddata` and `completion` index metric (supports wildcards)

  • :groups (List)

    A comma-separated list of search groups for ‘search` index metric

  • :level (String)

    Return stats aggregated at cluster, index or shard level (options: cluster, indices, shards)

  • :include_segment_file_sizes (Boolean)

    Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested)

  • :include_unloaded_segments (Boolean)

    If set to true segment stats will include stats for segments that are not currently loaded into memory

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :forbid_closed_indices (Boolean)

    If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices

  • :headers (Hash)

    Custom HTTP headers

See Also:



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/elasticsearch/api/actions/indices/stats.rb', line 42

def stats(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.stats' }

  defined_params = %i[metric index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = nil

  _metric = arguments.delete(:metric)

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index && _metric
             "#{Utils.__listify(_index)}/_stats/#{Utils.__listify(_metric)}"
           elsif _metric
             "_stats/#{Utils.__listify(_metric)}"
           elsif _index
             "#{Utils.__listify(_index)}/_stats"
           else
             '_stats'
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#unfreeze(arguments = {}) ⇒ Object

Unfreeze an index

*Deprecation notice*: Frozen indices are deprecated because they provide no benefit given improvements in heap memory utilization. They will be removed in a future release. Deprecated since version 7.14.0

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (String)

    The name of the index to unfreeze

  • :timeout (Time)

    Explicit operation timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :wait_for_active_shards (String)

    Sets the number of active shards to wait for before the operation returns.

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)

See Also:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/elasticsearch/api/actions/indices/unfreeze.rb', line 43

def unfreeze(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.unfreeze' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = nil

  _index = arguments.delete(:index)

  method = Elasticsearch::API::HTTP_POST
  path   = "#{Utils.__listify(_index)}/_unfreeze"
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#update_aliases(arguments = {}) ⇒ Object

Create or update an alias

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :timeout (Time)

    Request timeout

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The definition of ‘actions` to perform (Required)

Raises:

  • (ArgumentError)

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/elasticsearch/api/actions/indices/update_aliases.rb', line 34

def update_aliases(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.update_aliases' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_aliases'
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end

#validate_query(arguments = {}) ⇒ Object

Validate a query

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to restrict the operation; use ‘_all` or empty string to perform the operation on all indices

  • :explain (Boolean)

    Return detailed information about the error

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :q (String)

    Query in the Lucene query string syntax

  • :analyzer (String)

    The analyzer to use for the query string

  • :analyze_wildcard (Boolean)

    Specify whether wildcard and prefix queries should be analyzed (default: false)

  • :default_operator (String)

    The default operator for query string query (AND or OR) (options: AND, OR)

  • :df (String)

    The field to use as default where no field prefix is given in the query string

  • :lenient (Boolean)

    Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

  • :rewrite (Boolean)

    Provide a more detailed explanation showing the actual Lucene query that will be executed.

  • :all_shards (Boolean)

    Execute validation on all shards instead of one random shard per index

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    The query definition specified with the Query DSL

See Also:



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/elasticsearch/api/actions/indices/validate_query.rb', line 45

def validate_query(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'indices.validate_query' }

  defined_params = [:index].each_with_object({}) do |variable, set_variables|
    set_variables[variable] = arguments[variable] if arguments.key?(variable)
  end
  request_opts[:defined_params] = defined_params unless defined_params.empty?

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  _index = arguments.delete(:index)

  method = if body
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path = if _index
           "#{Utils.__listify(_index)}/_validate/query"
         else
           '_validate/query'
         end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers, request_opts)
  )
end