如何在Heroku上设置弹性搜索? [英] How to setup elasticsearch on Heroku?
问题描述
我们很抱歉,但出了问题。 p>
我做了英文日志,错误是:
16ms内完成500内部服务器错误(SearchKick:8.0ms |
ActiveRecord:0.0ms)
Faraday :: ConnectionFailed(Connection refused - connect(2)for
localhostport 9200): p>
请尝试这个................
Searchkick为Elasticsearch服务器使用ENV [ELASTICSEARCH_URL]。默认值为http:// localhost:9200。
Heroku
选择一个附加组件:SearchBox,Bonsai或Elastic Cloud。 p>
#SearchBox
heroku addons:create searchbox:starter
heroku config:set ELASTICSEARCH_URL =`heroku config:get SEARCHBOX_URL`
#盆景
heroku addons:create bonsai
heroku config:set ELASTICSEARCH_URL =`heroku config
#找到
heroku addons:create foundelasticsearch
/ pre>
heroku config:set ELASTICSEARCH_URL =`heroku config:get FOUNDELASTICSEARCH_URL`
然后部署和重新索引:
heroku run rake searchkick :reindex CLASS = Product
请参考这篇文档 https://github.com/ankane/searchkick#dep更多信息。
希望这将为您工作。谢谢!I've implemented elasticsearch/searchkick on my app and it works on development. My resources for the elasticsearch/searchkick implementation is GoRails and I installed elasticsearch successfully. But when I pushed it on Heroku, it gave me the error:
"We're sorry, but something went wrong."
I did heroku logs and the errors are:
"Completed 500 Internal Server Error in 16ms (Searchkick: 8.0ms | ActiveRecord: 0.0ms)"
and
"Faraday::ConnectionFailed (Connection refused - connect(2) for "localhost" port 9200):"
解决方案Please try this .................
Searchkick uses ENV["ELASTICSEARCH_URL"] for the Elasticsearch server. This defaults to http://localhost:9200. Heroku
Choose an add-on: SearchBox, Bonsai, or Elastic Cloud.
# SearchBox
heroku addons:create searchbox:starter heroku config:set ELASTICSEARCH_URL=`heroku config:get SEARCHBOX_URL`
# Bonsai
heroku addons:create bonsai heroku config:set ELASTICSEARCH_URL=`heroku config:get BONSAI_URL`
# Found
heroku addons:create foundelasticsearch heroku config:set ELASTICSEARCH_URL=`heroku config:get FOUNDELASTICSEARCH_URL`
Then deploy and reindex:
heroku run rake searchkick:reindex CLASS=Product
Please refer this documentation https://github.com/ankane/searchkick#deployment for more information. Hope this will work for you. Thanks!
这篇关于如何在Heroku上设置弹性搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!