public function onIndexRebuild(IndexRebuildEvent $event)
    {
        foreach ($this->adapter->listIndexes() as $indexName) {
            if (!$this->indexNameDecorator->isVariant($this->indexNameDecorator->undecorate($indexName), $indexName)) {
                continue;
            }

            $event->getOutput()->writeln(sprintf('<info>Optimizing zend lucene index:</info> %s', $indexName));
            $this->adapter->optimize($indexName);
        }
    }