Summary of problem or feature request
I got this error when tried to create an index:
{"error":"Incorrect HTTP method for uri [/] and method [PUT], allowed: [HEAD, DELETE, GET]","status":405}
I traced it down and found out that the reason is elasticsearch host. Originally, it had a trailing slash in my settings. And it worked fine for getAlias() for example. But failed for indices()->create().
The host URI needs to be sanitized probably.
Code snippet of problem
$params = [
'index' => $newIndexName,
];
$this->esClient->indices()->create($params));
System details
- Operating System Ubuntu 18.04
- PHP Version 7.4.4
- ES-PHP client version 7.6.1
- Elasticsearch version 7.4