protected function SearchApiElasticsearchBackend::doesTypeExists in Elasticsearch Connector 8.2
Same name and namespace in other branches
- 8.5 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::doesTypeExists()
- 8.6 src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php \Drupal\elasticsearch_connector\Plugin\search_api\backend\SearchApiElasticsearchBackend::doesTypeExists()
Helper function, check if the type exists.
Parameters
IndexInterface $index:
Return value
boolean
1 call to SearchApiElasticsearchBackend::doesTypeExists()
- SearchApiElasticsearchBackend::indexItems in src/
Plugin/ search_api/ backend/ SearchApiElasticsearchBackend.php - Indexes the specified items.
File
- src/
Plugin/ search_api/ backend/ SearchApiElasticsearchBackend.php, line 443 - 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
protected function doesTypeExists(IndexInterface $index) {
$params = IndexFactory::index($index, TRUE);
try {
return $this->client
->indices()
->existsType($params);
} catch (ElasticsearchException $e) {
drupal_set_message($e
->getMessage(), 'error');
return FALSE;
}
}