private function processConnectionConfiguration(ContainerBuilder $container, $config)
    {
        $alias = $this->getAlias();

        if (isset($config['default_connection'])) {
            $container->setParameter(
                "{$alias}.default_connection",
                $config['default_connection']
            );
        } elseif (!empty($config['connections'])) {
            reset($config['connections']);
            $container->setParameter(
                "{$alias}.default_connection",
                key($config['connections'])
            );
        }

        foreach ($config['connections'] as $name => $params) {
            $this->configureSearchServices($container, $name, $params);
            $container->setParameter("$alias.connection.$name", $params);
        }

        // Search engine itself, for given connection name
        $searchEngineDef = $container->findDefinition(self::MAIN_SEARCH_ENGINE_ID);
        $searchEngineDef->setFactory([new Reference('ezpublish.elasticsearch.engine_factory'), 'buildEngine']);
    }