You are here

public static function Cluster::elasticsearchCheckResponseAck in Elasticsearch Connector 8

Check if the REST response is successful and with status code 200.

Parameters

mixed $response:

Return value

bool

3 calls to Cluster::elasticsearchCheckResponseAck()
IndexForm::submit in src/Form/IndexForm.php
SearchApiElasticsearchBackend::addIndex in src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
Overrides addIndex().
SearchApiElasticsearchBackend::fieldsUpdated in src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
Overrides fieldsUpdated().

File

src/Entity/Cluster.php, line 222
Contains \Drupal\elasticsearch_connector\Entity\Cluster.

Class

Cluster
Defines the search server configuration entity.

Namespace

Drupal\elasticsearch_connector\Entity

Code

public static function elasticsearchCheckResponseAck($response) {
  if (is_array($response) && !empty($response['acknowledged'])) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}