in src/Endpoints/Indices.php [98:116]
public function analyze(?array $params = null)
{
$params = $params ?? [];
if (isset($params['index'])) {
$url = '/' . $this->encode($params['index']) . '/_analyze';
$method = empty($params['body']) ? 'GET' : 'POST';
} else {
$url = '/_analyze';
$method = empty($params['body']) ? 'GET' : 'POST';
}
$url = $this->addQueryString($url, $params, ['pretty','human','error_trace','source','filter_path']);
$headers = [
'Accept' => 'application/json',
'Content-Type' => 'application/json',
];
$request = $this->createRequest($method, $url, $headers, $params['body'] ?? null);
$request = $this->addOtelAttributes($params, ['index'], $request, 'indices.analyze');
return $this->client->sendRequest($request);
}