public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));

        $loader->load('converter.xml');
        $loader->load('event.xml');
        $loader->load('event_listeners.xml');
        $loader->load('command.xml');
        $loader->load('indexer.xml');
        $loader->load('queue.xml');
        $loader->load('solarium.xml');
        $loader->load('task.xml');
        $loader->load('types.xml');
        $loader->load('worker.xml');

        if ($container->getParameter('kernel.debug')) {
            $loader->load('collector.xml');
        }

        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $endpoints = [];

        foreach ($config['endpoints'] as $name => $options) {
            $options['key'] = $name;
            $container->setDefinition(
                'solarium.client.endpoint.' . $name,
                new Definition(Endpoint::class, [$options])
            );

            $endpoints[] = new Reference('solarium.client.endpoint.' . $name);
        }

        $container->setDefinition(
            'solarium.client',
            new Definition(
                Client::class,
                [
                    ['endpoint' => $endpoints],
                    new Reference('integrated_solr.event.dispatcher')
                ]
            )
        );

        if ($container->getParameter('kernel.debug')) {
            $container->getDefinition('solarium.client')->addMethodCall(
                'registerPlugin',
                ['solarium.client.logger', new Reference('integrated_solr.solarium.data_collector')]
            );
        }
    }