Smile\ElasticsuiteCatalog\Model\Category\Indexer\Fulltext\Action\Full::rebuildStoreIndex PHP Метод

rebuildStoreIndex() публичный Метод

If the product list ids is null, all categories data will be loaded.
public rebuildStoreIndex ( integer $storeId, array | null $categoryIds = null ) : Traversable
$storeId integer Store id.
$categoryIds array | null List of category ids.
Результат Traversable
    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));
    }

Usage Example

Пример #1
0
 /**
  * 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));
     }
 }