private function setupDoctrineListener(array $config, ContainerBuilder $container)
    {
        $autoIndexing = $container->getParameter('solr.auto_index');

        if ($autoIndexing == false) {
            return;
        }

        if ($this->isODMConfigured($container)) {
            $container->getDefinition('solr.document.odm.subscriber')->addTag('doctrine_mongodb.odm.event_subscriber');
        }

        if ($this->isOrmConfigured($container)) {
            $container->getDefinition('solr.document.orm.subscriber')->addTag('doctrine.event_subscriber');
        }
    }