I posted the solution in here:
http://stackoverflow.com/questions/25491110/set-connect-timeout-of-elasticsearch-php-client/25522782#25522782

this is the parameter that should be pass

$params['guzzleOptions']['curl.options'][CURLOPT_CONNECTTIMEOUT] = 2.0;  // 
this applies 2 seconds connection_timeout

Niv


On Monday, August 25, 2014 8:24:17 PM UTC+3, Niv Penso wrote:
>
> Hey,
>
> 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)
> (
> http://stackoverflow.com/questions/20847633/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?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/085d6625-5b18-4566-880e-43bed462ac6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to