Example #1
0
 /**
  * Execute materialization on ids entities
  *
  * @param int[] $ids The ids
  *
  * @return void
  */
 public function execute($ids)
 {
     $storeIds = array_keys($this->storeManager->getStores());
     foreach ($storeIds as $storeId) {
         $dimension = $this->dimensionFactory->create(['name' => 'scope', 'value' => $storeId]);
         $this->indexerHandler->deleteIndex([$dimension], new \ArrayObject($ids));
         $this->indexerHandler->saveIndex([$dimension], $this->fullAction->rebuildStoreIndex($storeId, $ids));
     }
 }
Example #2
0
 /**
  * Delete search index data for store
  *
  * @param int $storeId Store View Id
  * @param array $productIds Product Entity Id
  * @return void
  */
 protected function deleteIndex($storeId = null, $productIds = null)
 {
     $dimension = $this->dimensionFactory->create(['name' => self::SCOPE_FIELD_NAME, 'value' => $storeId]);
     $this->indexHandler->deleteIndex([$dimension], $this->getIterator($productIds));
 }