Searchkick with ElasticSearch returns “Faraday::ConnectionFailed: execution expired”

我的未来我决定 提交于 2019-12-02 07:24:53

Typically after hours of struggling I found the answer minutes after posting the question...

As per https://github.com/ankane/searchkick/issues/382 I added an initializer with:

Searchkick.client = Elasticsearch::Client.new(hosts: ["localhost:9200"], retry_on_failure: true, transport_options: {request: {timeout: 250}})

which seems to have solved the problem. I'll report back if it recurs.

Add below lines of code in config/initializers/elasticsearch.rb

Searchkick.client = Elasticsearch::Client.new(hosts: ["localhost:9200"], retry_on_failure: true, transport_options: {request: {timeout: 250}})

You can specify this according to Rails environment.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!