You are here

public function DESConnector::getClusterStatus in Elasticsearch Connector 8

Check if we have a connection the cluster.

Return value

bool

File

src/DESConnector/DESConnector.php, line 123
Provides Elasticsearch Client for Drupal's Elasticsearch Connector module.

Class

DESConnector
Drupal Elasticsearch Interface.

Namespace

Drupal\elasticsearch_connector\DESConnector

Code

public function getClusterStatus() {
  try {
    $health = $this
      ->getCluster()
      ->health();
    return $health['status'];
  } catch (Exception $e) {
    return FALSE;
  }
}