public static function DESConnector::getInstance in Elasticsearch Connector 8
Initializes the needed client.
TODO: We need to check the available options for the ClientBuilder and set them after the alter hook.
Parameters
array $hosts: The URLs of the Elasticsearch hosts.
Return value
Client
Overrides DESConnectorInterface::getInstance
2 methods override DESConnector::getInstance()
- DESConnector81::getInstance in src/
DESConnector/ DESConnector81.php - Initializes the needed client.
- DESConnector82::getInstance in src/
DESConnector/ DESConnector82.php - Initializes the needed client.
File
- src/
DESConnector/ DESConnector.php, line 74 - Provides Elasticsearch Client for Drupal's Elasticsearch Connector module.
Class
- DESConnector
- Drupal Elasticsearch Interface.
Namespace
Drupal\elasticsearch_connector\DESConnectorCode
public static function getInstance(array $hosts) {
if (ELASTICSEARCH_CONNECTOR_VERSION < 2) {
return DESConnector81::getInstance($hosts);
}
else {
return DESConnector82::getInstance($hosts);
}
}