public function purgeIndexes(IndexRebuildEvent $event)
    {
        if (!$event->getPurge()) {
            return;
        }

        foreach ($this->searchManager->getIndexNames() as $indexName) {
            $event->getOutput()->writeln('<info>Purging index</info>: ' . $indexName);
            $this->searchManager->purge($indexName);
        }
    }