You are here

public function SearchApiElasticsearchIndex::__construct in Search API Elasticsearch 7.2

SearchApiElasticsearchIndex constructor.

Parameters

SearchApiIndex $index:

SearchApiElasticsearchService $service:

File

includes/SearchApiElasticsearchIndex.inc, line 33

Class

SearchApiElasticsearchIndex

Code

public function __construct(SearchApiIndex $index, SearchApiElasticsearchService $service = null) {
  $this->search_api_index = $index;

  // We load the service directly for DX, but can fallback to the Search API
  // Server object because it has a proxy to the service.
  $this->search_api_service = isset($service) ? $service : $index
    ->server();
}