Reputation: 399
I am receiving the No handler found for uri [/<url>/<url>] and method [PUT]
error when sending a request via Elasticsearch.
I am using POST, not PUT, so I do not need to use _id. Using POST is mandatory. The following request worked until adding 'archive' index.
$params = [
'index' => 'servers',
'type' => 'servers',
'body' => [
'servername' => $servername,
'ip' => $ip,
'location' => $location,
'ping' => $ping,
'archive' => 0
]
];
$response = $client->index($params);
Upvotes: 0
Views: 1185
Reputation: 399
Rebuilding the index and changing archive
to a string, as opposed to an int, resolved the issue.
$params = [
'index' => 'servers',
'type' => 'servers',
'body' => [
'servername' => $servername,
'ip' => $ip,
'location' => $location,
'ping' => $ping,
'archive' => "0"
]
];
$response = $client->index($params);
Upvotes: 0