I build Elasticsearch(1.6) and php client(1.2). I write a demo code to index a document,the code is below.the document wiil be indexed in the ES successfully . but "$ret = $client->index($params);" wiil be not return. the program can only be shutdown with Ctrl+C. I check the source code of php client. I found the program will be endless loop in the function private function executeHandles() in guzzle/guzzle/src/Guzzle/Http/Curl/CurlMulti.php
So I hope you can help me?
Thanks in advance
the code is here:
require 'vendor/autoload.php';
//Elastic search php client
$params = array();
$params['hosts'] = array (
'http://localhost:8098',
);
$client = new Elasticsearch\Client($params);
$params = array();
$params['body'] = array('testField' => 'dddd');
$params['index'] = 'my_index';
$params['type'] = 'my_type';
$params['id'] = 'abc';
echo 'index begin!';
$ret = $client->index($params);
echo 'index end!';
var_dump($ret);