You are here

public function SearchApiElasticsearchElastica::updateSettings in Search API Elasticsearch 7

Update settings.

Overrides SearchApiElasticsearchAbstractService::updateSettings

File

modules/elastica/includes/SearchApiElasticsearchElastica.inc, line 814
Provides Elastica client for Search API Elasticsearch.

Class

SearchApiElasticsearchElastica
Search API Elasticsearch Elastica service class.

Code

public function updateSettings(SearchApiIndex $index, $data) {
  try {
    $elastica_index = $this
      ->getElasticaIndex($index);
    $elastica_index
      ->close();
    if ($data) {
      $elastica_index
        ->setSettings($data);
    }
    $elastica_index
      ->open();
  } catch (Exception $e) {
    watchdog('Elasticsearch', check_plain($e
      ->getMessage()), array(), WATCHDOG_ERROR);
    drupal_set_message(check_plain($e
      ->getMessage()), 'error');
    return FALSE;
  }
}