Following the elasticsearch documentation I installed the current php library ie 2.0 and I did this
$hosts = [
// This is effectively equal to: "https://username:password!#$?*abc@foo.com:9200/"
[
'host' => 'foo.com',
'port' => '9200',
'scheme' => 'https',
'user' => 'username',
'password' => 'password!#$?*abc'
],
// This is equal to "http://localhost:9200/"
[
'host' => 'localhost', // Only host is required
]
];
$client = ClientBuilder::create() // Instantiate a new ClientBuilder
->setHosts($hosts) // Set the hosts
->build();
But it is throwing array to string conversion error from the buildConnectionsFromHosts method. I am unable to establish connection.
I inspected the code and found that there is no code to process host given in array form.Is this the bug in the library or I am missing something?
Thank you.