Ste*_*ead 1 ruby-on-rails elasticsearch searchkick
我一直在使用带有elasticsearch的searchkick gem,在Rails 4.2.0应用程序上没有任何问题.我有一个使用searchkick的视频模型.
出于某种原因rake searchkick:reindex:all,现在却始终如一地失败:
重新索引视频...耙子中止了!法拉第:: ConnectionFailed:执行过期
我最初安装了elasticsearch via brew install elasticsearch,它返回:
警告:elasticsearch-1.3.4已经安装
我的elasticsearch安装/数据库是否可能已损坏?如果是这样,刷新它的最佳方法是什么?
根据https://www.elastic.co/guide/en/elasticsearch/reference/1.4/indices-delete-index.html我试过,curl -XDELETE 'http://localhost:9200/_all'但这不能解决错误.
当我将此代码部署到AWS时,我的Mac以及Elastic Beanstalk都会出现此问题(两者以前都正常工作).
通常经过几个小时的挣扎后,我在发布问题后找到答案的几分钟......
根据https://github.com/ankane/searchkick/issues/382我添加了一个初始化程序:
Searchkick.client = Elasticsearch::Client.new(hosts: ["localhost:9200"], retry_on_failure: true, transport_options: {request: {timeout: 250}})
Run Code Online (Sandbox Code Playgroud)
这似乎解决了这个问题.我会报告它是否再次出现.
| 归档时间: |
|
| 查看次数: |
3571 次 |
| 最近记录: |