How to do bulk delete in PHP ElasticSearch API? I know that there are issues with delete by query princip, so I want to try the bulk delete function, but I don't know how to use it. So, I want to know how to use the $client -> bulk method of the ElasticSearch PHP API. Anyone?
Turns out it is very simple:
for ($i = 303; $i < 310; $i++) {
$params ['body'][] = array(
'delete' => array(
'_index' => 'er',
'_type' => 'state',
'_id' => $i
)
);
}
$response = $client -> bulk($params);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With