Esempio n. 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));
     }
 }
Esempio n. 2
0
 /**
  * Regenerate search index for all stores
  *
  * @param int|array|null $productIds
  * @return void
  */
 protected function rebuildIndex($productIds = null)
 {
     $storeIds = array_keys($this->storeManager->getStores());
     foreach ($storeIds as $storeId) {
         $dimension = $this->dimensionFactory->create(['name' => self::SCOPE_FIELD_NAME, 'value' => $storeId]);
         $this->indexHandler->deleteIndex([$dimension], $this->getIterator($productIds));
         $this->indexHandler->saveIndex([$dimension], $this->rebuildStoreIndex($storeId, $productIds));
     }
     $this->fulltextResource->resetSearchResults();
     $this->searchRequestConfig->reset();
 }