ElasticSearch has a well-documented JSON API, but you'll probably want to use some libraries that handle that for you:
Elasticsearch
- the official low level wrapper for the HTTP API
Elasticsearch-rails
- the official high level Rails integration that helps you to connect your Rails models with ElasticSearch using either ActiveRecord or Repository pattern
Chewy
- An alternative, non-official high level Rails integration that is very popular and arguably has better documentation
Let's use the first option for testing the connection:
gem install elasticsearch
Then fire up the ruby terminal and try it out:
require 'elasticsearch'
client = Elasticsearch::Client.new log: true
# by default it connects to http://localhost:9200
client.transport.reload_connections!
client.cluster.health
client.search q: 'test'