Sha256: ea1dd07bc06c9847be1678379ac296c696bb9bc992d5501f0a5d57378aaf128e

Contents?: true

Size: 533 Bytes

Versions: 2

Compression:

Stored size: 533 Bytes

Contents

class ChangeESIndexSettings
  def initialize(options = {})
    @host = options[:host]
    @port = options[:port]
    @index = options[:index]
    @settings_and_values = options[:settings_and_values]
  end

  def change_setting(setting, value)
    puts "changing setting #{setting} to value #{value}"
    `curl -s -XPUT 'http://#{@host}:#{@port}/#{@index}/_settings?pretty=true' -d '{ "#{setting}":"#{value}" }'`
  end

  def run
    @settings_and_values.each do |setting, value|
      change_setting(setting, value)
    end
  end
end

Version data entries

2 entries across 1 versions & 1 rubygems

Version Path
wonderdog-0.2.0 squirrel/change_es_index_settings.rb
wonderdog-0.2.0 test/change_es_index_settings.rb