Closed MonkWang closed 5 months ago
@MonkWang the exists()
endpoint return true
or false
using the asBool()
function. This is because the Elasticsearch exists API does not return a body and the asArray()
returns an error. You should use as follows:
$params = [ 'index' => 'not_existing_index'];
$response = $client->indices()->exists($params)->asBool();
var_dump($response); // bool(false)
Summary of problem or feature request
when i want to check the index exsist, then it's reported "Not a valid Json: Syntax error"
Code snippet of problem
System details