Sha256: 31fb6d277ea1c3ab934dcea059382071d15df7b9784d46884d350aa4a009334f

Contents?: true

Size: 1.69 KB

Versions: 2

Compression:

Stored size: 1.69 KB

Contents

module Elasticsearch
  module API
    module Indices
      module Actions

        # Update the settings for one or multiple indices.
        #
        # @example Change the number of replicas for all indices
        #
        #     client.indices.put_settings body: { index: { number_of_replicas: 0 } }
        #
        #
        # @example Change the number of replicas for a specific index
        #
        #     client.indices.put_settings index: 'myindex', body: { index: { number_of_replicas: 0 } }
        #
        #
        # @example Disable "flush" for all indices
        #
        #     client.indices.put_settings body: { 'index.translog.disable_flush' => true }
        #
        # @example Allocate specific index on specific nodes
        #
        #     client.indices.put_settings index: 'my-big-index',
        #                                 body: { 'index.routing.allocation.require.tag' => 'bigbox' }
        #
        # @option arguments [Hash] :body The index settings to be updated (*Required*)
        # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string
        #                                to perform the operation on all indices
        #
        # @see http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings/
        #
        def put_settings(arguments={})
          raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
          method = 'PUT'
          path   = Utils.__pathify( Utils.__listify(arguments[:index]), '_settings' )
          params = {}
          body   = arguments[:body]

          perform_request(method, path, params, body).body
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
elasticsearch-api-0.4.0 lib/elasticsearch/api/actions/indices/put_settings.rb
elasticsearch-api-0.0.2 lib/elasticsearch/api/actions/indices/put_settings.rb