Algolia_Algoliasearch_Helper_Data::rebuildStorePageIndex PHP 메소드

rebuildStorePageIndex() 공개 메소드

public rebuildStorePageIndex ( $storeId )
    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);
    }

Usage Example

예제 #1
0
 public function rebuildPageIndex(Varien_Object $event)
 {
     $storeId = $event->getStoreId();
     $this->helper->rebuildStorePageIndex($storeId);
 }