Elasticsearch client library written for people who like understandable documentation and understandable code.
Add this line to your application's Gemfile:
gem 'stretch'
And then execute:
$ bundle
Or install it yourself as:
$ gem install stretch
$stretch = Stretch::Client.new :url => "http://127.0.0.1:9200/"
$stretch.cluster.health :timeout => '10s'
$stretch.index('tweets').health :wait_for_status => 'green'
$stretch.cluster.state
$stretch.cluster.state :filter_nodes => true
$stretch.cluster.settings :persistent => {
"cluster.routing.allocation.node_concurrent_recoveries" => 4
}
$stretch.index('foo').settings :index => { :number_of_replicas => 2 }
$stretch.index('foo').open!
$stretch.index('bar').close!