public function buildEngine()
{
$repositoryConfig = $this->repositoryConfigurationProvider->getRepositoryConfig();
$connection = $this->defaultConnection;
if (isset($repositoryConfig['search']['connection'])) {
$connection = $repositoryConfig['search']['connection'];
}
return new $this->searchEngineClass($this->container->get(sprintf('%s.%s', EzPublishElasticsearchSearchEngineExtension::CONTENT_SEARCH_GATEWAY_ID, $connection)), $this->container->get(sprintf('%s.%s', EzPublishElasticsearchSearchEngineExtension::LOCATION_SEARCH_GATEWAY_ID, $connection)), $this->container->get('ezpublish.search.elasticsearch.mapper'), $this->container->get('ezpublish.search.elasticsearch.extractor'), $this->container->getParameter("ez_search_engine_elasticsearch.connection.{$connection}.location_document_type_identifier"), $this->container->getParameter("ez_search_engine_elasticsearch.connection.{$connection}.location_document_type_identifier"));
}