protected function clearIndex(IndexerInterface $indexer, InputInterface $input, OutputInterface $output)
    {
        if (!$input->getOption('clear')) {
            return;
        }

        $context = $this->getContainer()->getParameter('sulu.context');
        $output->writeln(sprintf('Cleared index for the <comment>`%s`</comment> context', $context));
        $indexer->clear();
    }