Пример #1
0
 public function rebuildStorePageIndex($storeId)
 {
     if ($this->config->isEnabledBackend($storeId) === false) {
         $this->logger->log('INDEXING IS DISABLED FOR ' . $this->logger->getStoreName($storeId));
         return;
     }
     $emulationInfo = $this->startEmulation($storeId);
     $index_name = $this->page_helper->getIndexName($storeId);
     $pages = $this->page_helper->getPages($storeId);
     foreach (array_chunk($pages, 100) as $chunk) {
         $this->algolia_helper->addObjects($chunk, $index_name . '_tmp');
     }
     $this->algolia_helper->moveIndex($index_name . '_tmp', $index_name);
     $this->algolia_helper->setSettings($index_name, $this->page_helper->getIndexSettings($storeId));
     $this->stopEmulation($emulationInfo);
 }