You are here

protected function SearchApiElasticsearchService::configureClient in Search API Elasticsearch 7.2

Configure Elastica\Client.

Return value

array

1 call to SearchApiElasticsearchService::configureClient()
SearchApiElasticsearchService::getClient in includes/SearchApiElasticsearchService.inc
Helper method for accessing Elastica\Client.

File

includes/SearchApiElasticsearchService.inc, line 370
Provides Elasticsearch service for Search API.

Class

SearchApiElasticsearchService
@file Provides Elasticsearch service for Search API.

Code

protected function configureClient() {
  $config = [];
  if (count($this->options) > 1) {
    foreach ($this->options as $id => $option) {
      if ($id === 'facet_limit') {
        continue;
      }
      $config[] = $option;
    }
  }
  else {
    $config = $this->options;
  }
  return [
    'servers' => $config,
  ];
}