in src/Endpoints/Indices.php [2627:2645]
public function validateQuery(?array $params = null)
{
$params = $params ?? [];
if (isset($params['index'])) {
$url = '/' . $this->encode($this->convertValue($params['index'])) . '/_validate/query';
$method = empty($params['body']) ? 'GET' : 'POST';
} else {
$url = '/_validate/query';
$method = empty($params['body']) ? 'GET' : 'POST';
}
$url = $this->addQueryString($url, $params, ['explain','ignore_unavailable','allow_no_indices','expand_wildcards','q','analyzer','analyze_wildcard','default_operator','df','lenient','rewrite','all_shards','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.validate_query');
return $this->client->sendRequest($request);
}