【发布时间】:2023-03-28 09:36:01
【问题描述】:
我在通过 Elasticsearch 发送请求时收到 No handler found for uri [/<url>/<url>] and method [PUT] 错误。
我使用的是 POST,而不是 PUT,所以我不需要使用 _id。必须使用 POST。在添加“存档”索引之前,以下请求一直有效。
$params = [
'index' => 'servers',
'type' => 'servers',
'body' => [
'servername' => $servername,
'ip' => $ip,
'location' => $location,
'ping' => $ping,
'archive' => 0
]
];
$response = $client->index($params);
【问题讨论】:
标签: php arrays json elasticsearch