private function configureSearchServices(ContainerBuilder $container, $connectionName, $connectionParams)
    {
        $alias = $this->getAlias();

        // Http client
        $httpClientId = static::HTTP_CLIENT_ID . ".$connectionName";
        $httpClientDef = new DefinitionDecorator(self::HTTP_CLIENT_ID);
        $httpClientDef->replaceArgument(0, $connectionParams['server']);
        $container->setDefinition($httpClientId, $httpClientDef);

        // Content search gateway
        $contentSearchGatewayDef = new DefinitionDecorator(self::CONTENT_SEARCH_GATEWAY_ID);
        $contentSearchGatewayDef->replaceArgument(0, new Reference($httpClientId));
        $contentSearchGatewayDef->replaceArgument(5, $connectionParams['index_name']);
        $contentSearchGatewayId = self::CONTENT_SEARCH_GATEWAY_ID . ".$connectionName";
        $container->setDefinition($contentSearchGatewayId, $contentSearchGatewayDef);

        // Location search gateway
        $locationSearchGatewayDef = new DefinitionDecorator(self::LOCATION_SEARCH_GATEWAY_ID);
        $locationSearchGatewayDef->replaceArgument(0, new Reference($httpClientId));
        $locationSearchGatewayDef->replaceArgument(5, $connectionParams['index_name']);
        $locationSearchGatewayId = self::LOCATION_SEARCH_GATEWAY_ID . ".$connectionName";
        $container->setDefinition($locationSearchGatewayId, $locationSearchGatewayDef);

        $container->setParameter(
            "$alias.connection.$connectionName.content_document_type_identifier",
            $connectionParams['document_type_name']['content']
        );
        $container->setParameter(
            "$alias.connection.$connectionName.location_document_type_identifier",
            $connectionParams['document_type_name']['location']
        );
    }
private function configureSearchServices(ContainerBuilder $container, $connectionName, $connectionParams)
    {
        $alias = $this->getAlias();

        // Http client
        $httpClientId = static::HTTP_CLIENT_ID . ".$connectionName";
        $httpClientDef = new DefinitionDecorator(self::HTTP_CLIENT_ID);
        $httpClientDef->replaceArgument(0, $connectionParams['server']);
        $container->setDefinition($httpClientId, $httpClientDef);

        // Content search gateway
        $contentSearchGatewayDef = new DefinitionDecorator(self::CONTENT_SEARCH_GATEWAY_ID);
        $contentSearchGatewayDef->replaceArgument(0, new Reference($httpClientId));
        $contentSearchGatewayDef->replaceArgument(5, $connectionParams['index_name']);
        $contentSearchGatewayId = self::CONTENT_SEARCH_GATEWAY_ID . ".$connectionName";
        $container->setDefinition($contentSearchGatewayId, $contentSearchGatewayDef);

        // Location search gateway
        $locationSearchGatewayDef = new DefinitionDecorator(self::LOCATION_SEARCH_GATEWAY_ID);
        $locationSearchGatewayDef->replaceArgument(0, new Reference($httpClientId));
        $locationSearchGatewayDef->replaceArgument(5, $connectionParams['index_name']);
        $locationSearchGatewayId = self::LOCATION_SEARCH_GATEWAY_ID . ".$connectionName";
        $container->setDefinition($locationSearchGatewayId, $locationSearchGatewayDef);

        $container->setParameter(
            "$alias.connection.$connectionName.content_document_type_identifier",
            $connectionParams['document_type_name']['content']
        );
        $container->setParameter(
            "$alias.connection.$connectionName.location_document_type_identifier",
            $connectionParams['document_type_name']['location']
        );
    }
private function configureSearchServices ( ContainerBuilder $ container , $ connectionName , $ connectionParams ) { $ alias = $ this -> getAlias ( ) ; // Http client $ httpClientId = static :: HTTP_CLIENT_ID . ".$connectionName" ; $ httpClientDef = new DefinitionDecorator ( self :: HTTP_CLIENT_ID ) ; $ httpClientDef -> replaceArgument ( 0 , $ connectionParams [ 'server' ] ) ; $ container -> setDefinition ( $ httpClientId , $ httpClientDef ) ; // Content search gateway $ contentSearchGatewayDef = new DefinitionDecorator ( self :: CONTENT_SEARCH_GATEWAY_ID ) ; $ contentSearchGatewayDef -> replaceArgument ( 0 , new Reference ( $ httpClientId ) ) ; $ contentSearchGatewayDef -> replaceArgument ( 5 , $ connectionParams [ 'index_name' ] ) ; $ contentSearchGatewayId = self :: CONTENT_SEARCH_GATEWAY_ID . ".$connectionName" ; $ container -> setDefinition ( $ contentSearchGatewayId , $ contentSearchGatewayDef ) ; // Location search gateway $ locationSearchGatewayDef = new DefinitionDecorator ( self :: LOCATION_SEARCH_GATEWAY_ID ) ; $ locationSearchGatewayDef -> replaceArgument ( 0 , new Reference ( $ httpClientId ) ) ; $ locationSearchGatewayDef -> replaceArgument ( 5 , $ connectionParams [ 'index_name' ] ) ; $ locationSearchGatewayId = self :: LOCATION_SEARCH_GATEWAY_ID . ".$connectionName" ; $ container -> setDefinition ( $ locationSearchGatewayId , $ locationSearchGatewayDef ) ; $ container -> setParameter ( "$alias.connection.$connectionName.content_document_type_identifier" , $ connectionParams [ 'document_type_name' ] [ 'content' ] ) ; $ container -> setParameter ( "$alias.connection.$connectionName.location_document_type_identifier" , $ connectionParams [ 'document_type_name' ] [ 'location' ] ) ; }
Creates needed search services for given connection name and parameters.

@param ContainerBuilder $container
@param string $connectionName
@param array $connectionParams
Creates needed search services for given connection name and parameters .