public function rebuildStoreIndex($storeId, $categoryIds = null) { $lastCategoryId = 0; do { $categories = $this->getSearchableCategories($storeId, $categoryIds, $lastCategoryId); foreach ($categories as $categoryData) { $lastCategoryId = (int) $categoryData['entity_id']; (yield $lastCategoryId => $categoryData); } } while (!empty($categories)); }
/** * Execute full indexation * * @return void */ public function executeFull() { $storeIds = array_keys($this->storeManager->getStores()); foreach ($storeIds as $storeId) { $dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]); $this->indexerHandler->cleanIndex([$dimension]); $this->indexerHandler->saveIndex([$dimension], $this->fullAction->rebuildStoreIndex($storeId)); } }