Send wildcard request through php client

DELETE /logstash-task-2390-*

How to send this request through the PHP client?

The same way you can delete any index in PHP: just use wildcards in the index name as you please.

<?php

require 'vendor/autoload.php';

use Elasticsearch\ClientBuilder;

$hosts = ['http://127.0.0.1:9200'];
$client = ClientBuilder::create()->setHosts($hosts)->build();

$params = ['index' => 'logstash-task-2390-*'];
$response = $client->indices()->delete($params);

?>

thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.