Send wildcard request through php client


(zhenjie) #1
DELETE /logstash-task-2390-*

How to send this request through the PHP client?


(Shane Connelly) #2

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);

?>

(zhenjie) #3

thanks´╝ü


(system) #4

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