protected function reindexUpdatedCategories($categoryId)
    {
        /** @var $category \Magento\Catalog\Model\Category */
        $category = $this->defaultCategory->load($categoryId);
        //$categoryName = $category->getName();
        foreach ($category->getStoreIds() as $storeId) {
            if ($storeId == 0) {
                continue;
            }

            $category = $this->categoryRepository->get($categoryId, $storeId);

            $urlRewrites = $this->categoryUrlRewriteGenerator->generate($category, true);
            $this->urlPersist->replace($urlRewrites);
        }
        return $this;
    }
protected function reindexUpdatedCategories($categoryId)
    {
        /** @var $category \Magento\Catalog\Model\Category */
        $category = $this->defaultCategory->load($categoryId);
        //$categoryName = $category->getName();
        foreach ($category->getStoreIds() as $storeId) {
            if ($storeId == 0) {
                continue;
            }

            $category = $this->categoryRepository->get($categoryId, $storeId);

            $urlRewrites = $this->categoryUrlRewriteGenerator->generate($category, true);
            $this->urlPersist->replace($urlRewrites);
        }
        return $this;
    }
protected function reindexUpdatedCategories ( $ categoryId ) { /** @var $category \Magento\Catalog\Model\Category */ $ category = $ this -> defaultCategory -> load ( $ categoryId ) ; //$categoryName = $category->getName(); foreach ( $ category -> getStoreIds ( ) as $ storeId ) { if ( $ storeId == 0 ) { continue ; } $ category = $ this -> categoryRepository -> get ( $ categoryId , $ storeId ) ; $ urlRewrites = $ this -> categoryUrlRewriteGenerator -> generate ( $ category , true ) ; $ this -> urlPersist -> replace ( $ urlRewrites ) ; } return $ this ; }
Reindex all categories
@return $this
@throws \Exception
Reindex all categories