Set Faraday Timeout to Ruby ElasticSearch Client

Is it possible to set the timeoutFaraday transport property when creating Ruby Elasticsearch::Client? It is possible to pass a block during instance initialization Elasticsearch::Transport::Transport::Faraday, but when trying below we only get an empty set of connections from __build_connections:

transport = Elasticsearch::Transport::Transport::HTTP::Faraday.new do |connection|
  # connection.timeout = 1 # ???
end

Any suggestions on how we should implement this block to set a timeout?

+3
source share
1 answer

you can run this.

Elasticsearch::Client.new transport_options: {
  request: { timeout: 1 }
}
+10
source

All Articles