I'm using the new ElasticSearch Ruby gems:
gem 'elasticsearch'
gem 'elasticsearch-model'
gem 'elasticsearch-rails'
I'm a bit puzzled by the fact that it's returning results, without having any instance of ElasticSearch running...
For instance, I do:
Tag.search("stackoverflow").results.first
And it actually returns an #<Elasticsearch::Model::Response::Result>
instance, containing "stackoverflow".
Here a gif of the issue: http://i.imgur.com/8jGB5x1.gif
Where does it come from?
To test whether ElasticSearch
is running or not, try this in terminal:
curl -X GET 'http://localhost:9200'
The response will be similar to this:
{
"ok" : true,
"status" : 200,
"name" : "Destroyer, The",
"version" : {
"number" : "0.90.7",
"build_hash" : "36897d07dadcb70886db7f149e645ed3d44eb5f2",
"build_timestamp" : "2013-11-13T12:06:54Z",
"build_snapshot" : false,
"lucene_version" : "4.5.1"
},
"tagline" : "You Know, for Search"
}
I actually had setup the elasticsearch client to connect to bonsai.io...
Elasticsearch::Model.client = Elasticsearch::Client.new({
host: bonsai_host
})
I did it when deploying to heroku, and completely forgot.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.