New

The executive guide to generative AI

Read more

Delete an index

edit

Due to the dynamic nature of elasticsearch, the first document we added automatically built an index with some default settings. Let’s delete that index because we want to specify our own settings later:

$deleteParams = [
    'index' => 'my_index'
];
$response = $client->indices()->delete($deleteParams);
print_r($response);

The response:

Array
(
    [acknowledged] => 1
)
Was this helpful?
Feedback