public static function IndexFactory::bulkDelete in Elasticsearch Connector 8.2
Same name and namespace in other branches
- 8.7 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::bulkDelete()
- 8.5 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::bulkDelete()
- 8.6 src/ElasticSearch/Parameters/Factory/IndexFactory.php \Drupal\elasticsearch_connector\ElasticSearch\Parameters\Factory\IndexFactory::bulkDelete()
Build parameters to bulk delete indexes.
Parameters
\Drupal\search_api\IndexInterface $index:
array $ids:
Return value
array
1 call to IndexFactory::bulkDelete()
- SearchApiElasticsearchBackend::deleteItems in src/
Plugin/ search_api/ backend/ SearchApiElasticsearchBackend.php - Deletes the specified items from the index.
File
- src/
ElasticSearch/ Parameters/ Factory/ IndexFactory.php, line 68
Class
- IndexFactory
- Class IndexFactory.
Namespace
Drupal\elasticsearch_connector\ElasticSearch\Parameters\FactoryCode
public static function bulkDelete(IndexInterface $index, array $ids) {
$params = IndexFactory::index($index, TRUE);
foreach ($ids as $id) {
$params['body'][] = [
'delete' => [
'_index' => $params['index'],
'_type' => $params['type'],
'_id' => $id,
],
];
}
return $params;
}