| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 | = elasticsearch-ruby== OverviewThere's a suite of official Ruby libraries for Elasticsearch, which provide a client for connectingto Elasticsearch clusters, Ruby interface to the REST API, and more.See the full documentation at http://github.com/elasticsearch/elasticsearch-ruby.=== Elasticsearch Version CompatibilityThe Ruby libraries are compatible with both Elasticsearch 0.90.x and 1.0.x versions,but you have to install a matching http://rubygems.org/gems/elasticsearch/versions[gem version]:[cols="<,<",options="header",]|=========================================| Elasticsearch version | Ruby gem version| 0.90.x                | 0.4.x| 1.0.x                 | 1.x|============================================ InstallationInstall the Ruby gem for Elasticsearch *1.x*:[source,sh]------------------------------------gem install elasticsearch------------------------------------...or add it do your Gemfile:[source,ruby]------------------------------------gem 'elasticsearch'------------------------------------Install the Ruby gem for Elasticsearch *0.90.x*:[source,sh]------------------------------------gem install elasticsearch -v 0.4.10------------------------------------...or add it do your Gemfile:[source,ruby]------------------------------------gem 'elasticsearch', '~> 0.4'------------------------------------=== Example Usage[source,ruby]------------------------------------require 'elasticsearch'client = Elasticsearch::Client.new log: trueclient.cluster.healthclient.index index: 'my-index', type: 'my-document', id: 1, body: { title: 'Test' }client.indices.refresh index: 'my-index'client.search index: 'my-index', body: { query: { match: { title: 'test' } } }------------------------------------=== Features at a Glance* Pluggable logging and tracing* Plugabble connection selection strategies (round-robin, random, custom)* Pluggable transport implementation, customizable and extendable* Pluggable serializer implementation* Request retries and dead connections handling* Node reloading (based on cluster state) on errors or on demand* Modular API implementation* 100% REST API coverage== Copyright and LicenseThis software is Copyright (c) 2013 by Elasticsearch BV.This is free software, licensed under The Apache License Version 2.0.
 |