private function reindexFlatCategories()
    {
        if ($this->flatCategoryIndexState->isFlatEnabled()) {
            $flatCategoryIndexer = $this->indexerRegistry->get(\Magento\Catalog\Model\Indexer\Category\Flat\State::INDEXER_ID);
            $flatCategoryIndexer->reindexAll();
        }
    }