5

Is it possible to set the timeout property of a Faraday transport when creating a Ruby Elasticsearch::Client? There is the scope to pass a block when initializing an Elasticsearch::Transport::Transport::Faraday instance, but when trying the below we only ever get an empty set of connections back from __build_connections:

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

Any suggestions as to how we should implement this block to set the timeout?

DeejUK
  • 12,891
  • 19
  • 89
  • 169

1 Answers1

15

you can run this.

Elasticsearch::Client.new transport_options: {
  request: { timeout: 1 }
}
zeroed
  • 548
  • 1
  • 7
  • 15
Joy Hu
  • 556
  • 5
  • 9