i want to configure a a small timeout between my elasticsearch php client to the my elasticsearch server.
i tried to pass some parameters to the guzzle client but it seems this doesn't work. here is the code:
$params = array();
$params['hosts'] = $hosts;
$params['guzzleOptions']['connect_timeout'] = 2.0;
$params['guzzleOptions']['timeout'] = 2.0;
$this->elastica_obj = new Elasticsearch\Client($params);
i searched and found that the problem might occured because the timeout is set in the cURL layer (that is lower than the guzzle) (Limit connecting time with Guzzle HTTP PHP client)
i guess i need somehow to set CURLOPT_CONNECTTIMEOUT_MS parameter to the value i want (2000ms) but i don't see any good way to pass it through the elasticsearch php client.
Does someone knows how to do it?