public function SearchApiElasticsearchBackend::removeIndex in Elasticsearch Connector 8
Same name and namespace in other branches
- 8.7 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::removeIndex()
- 8.2 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::removeIndex()
- 8.5 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::removeIndex()
- 8.6 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::removeIndex()
Overrides removeIndex().
Overrides BackendPluginBase::removeIndex
1 call to SearchApiElasticsearchBackend::removeIndex()
- SearchApiElasticsearchBackend::deleteAllIndexItems in src/
Plugin/ search_api/ backend/ SearchApiElasticsearchBackend.php - Deletes all the items from the index.
File
- src/
Plugin/ search_api/ backend/ SearchApiElasticsearchBackend.php, line 440 - Contains the SearchApiElasticsearchBackend object.
Class
- SearchApiElasticsearchBackend
- Plugin annotation @SearchApiBackend( id = "elasticsearch", label = @Translation("Elasticsearch"), description = @Translation("Index items using an Elasticsearch server.") )
Namespace
Drupal\elasticsearch_connector\Plugin\search_api\backendCode
public function removeIndex($index) {
$this
->connect();
$params = $this
->getIndexParam($index);
try {
$response = $this->elasticsearchClient
->getIndices()
->delete($params);
} catch (\Exception $e) {
drupal_set_message($e
->getMessage(), 'error');
}
}