I want to access the data in Elastic Search Cluster
from my rails
application. Lets say server is running at http://localhost:9200
and I want to access the end point http://localhost:9200/location/type
.
The following this documentation and came across this example:
require 'elasticsearch'
client = Elasticsearch::Client.new log: true
client.cluster.health
client.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' } } }
Questions:
- where I will define the details of my
elasticsearch cluster
in the code? the cluster is running athttp://localhost:9200/