in src/Traits/ClientEndpointsTrait.php [204:222]
public function count(?array $params = null)
{
$params = $params ?? [];
if (isset($params['index'])) {
$url = '/' . $this->encode($this->convertValue($params['index'])) . '/_count';
$method = empty($params['body']) ? 'GET' : 'POST';
} else {
$url = '/_count';
$method = empty($params['body']) ? 'GET' : 'POST';
}
$url = $this->addQueryString($url, $params, ['ignore_unavailable','ignore_throttled','allow_no_indices','expand_wildcards','min_score','preference','routing','q','analyzer','analyze_wildcard','default_operator','df','lenient','terminate_after','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, 'count');
return $this->sendRequest($request);
}