You are here

public function SearchApiElasticsearchElastica::getSettings in Search API Elasticsearch 7

Get settings.

Overrides SearchApiElasticsearchAbstractService::getSettings

File

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

Class

SearchApiElasticsearchElastica
Search API Elasticsearch Elastica service class.

Code

public function getSettings(SearchApiIndex $index) {
  try {
    $elastica_index = $this
      ->getElasticaIndex($index);
    if ($elastica_index) {
      $settings = $elastica_index
        ->getSettings()
        ->get();
      if (!empty($settings)) {
        $settings = $this
          ->filterSettings($settings);
        return $settings;
      }
    }
  } catch (Exception $e) {
    watchdog('Elasticsearch', check_plain($e
      ->getMessage()), array(), WATCHDOG_ERROR);
    drupal_set_message(check_plain($e
      ->getMessage()), 'error');
  }
  return FALSE;
}