コード例 #1
0
 /**
  * Refresh rows by ids from changelog.
  *
  * @return Smile_ElasticSearch_Model_Index_Action_Search_Terms_Refresh_Changelog
  *
  * @throws Enterprise_Index_Model_Action_Exception
  */
 public function execute()
 {
     if (!$this->_metadata->isValid()) {
         throw new Enterprise_Index_Model_Action_Exception("Can't perform operation, incomplete metadata!");
     }
     if (Mage::helper('smile_elasticsearch')->isActiveEngine() == true) {
         $this->_setProductIdsFromValue();
         $engine = Mage::helper('catalogsearch')->getEngine();
         $mapping = $engine->getCurrentIndex()->getMapping('product');
         $dataprovider = $mapping->getDataProvider('search_terms_position');
         $dataprovider->updateAllData(null, $this->_productIds);
     }
     return $this;
 }
コード例 #2
0
 /**
  * Refresh rows by ids from changelog.
  *
  * @return Smile_VirtualCategories_Model_Index_Action_VirtualCategories_Product_Position_Refresh_Changelog
  *
  * @throws Enterprise_Index_Model_Action_Exception
  */
 public function execute()
 {
     if (!$this->_metadata->isValid()) {
         throw new Enterprise_Index_Model_Action_Exception("Can't perform operation, incomplete metadata!");
     }
     if (Mage::helper('smile_elasticsearch')->isActiveEngine() == true) {
         try {
             if (!empty($this->_changedIds)) {
                 $this->_metadata->setInProgressStatus()->save();
                 $engine = Mage::helper('catalogsearch')->getEngine();
                 $mapping = $engine->getCurrentIndex()->getMapping('product');
                 $dataprovider = $mapping->getDataProvider('virtual_categories_products_position');
                 $dataprovider->updateAllData(null, $this->_changedIds);
                 $this->_updateMetadata();
             }
         } catch (Exception $e) {
             $this->_metadata->setInvalidStatus()->save();
             throw new Enterprise_Index_Model_Action_Exception($e->getMessage(), $e->getCode());
         }
     }
     return $this;
 }
コード例 #3
0
ファイル: Refresh.php プロジェクト: hyhoocchan/mage-local
 /**
  * Run full reindex
  *
  * @return Enterprise_Catalog_Model_Index_Action_Catalog_Category_Product_Refresh
  * @throws Enterprise_Index_Model_Action_Exception
  */
 public function execute()
 {
     if (!$this->_metadata->isValid()) {
         throw new Enterprise_Index_Model_Action_Exception("Can't perform operation, incomplete metadata!");
     }
     try {
         $this->_reindex();
         $this->_app->dispatchEvent('enterprise_after_reindex_process_catalog_category_product', array());
         $this->_dispatchNotification();
     } catch (Exception $e) {
         $this->_metadata->setInvalidStatus()->save();
         throw new Enterprise_Index_Model_Action_Exception($e->getMessage(), $e->getCode(), $e);
     }
     return $this;
 }
コード例 #4
0
 /**
  * Run full reindex
  *
  * @return Enterprise_CatalogSearch_Model_Index_Action_Fulltext_Refresh
  * @throws Enterprise_Index_Model_Action_Exception
  */
 public function execute()
 {
     if (!$this->_metadata->isValid()) {
         throw new Enterprise_Index_Model_Action_Exception("Can't perform operation, incomplete metadata!");
     }
     try {
         $this->_getLastVersionId();
         $this->_metadata->setInProgressStatus()->save();
         // Reindex all products
         $this->_indexer->rebuildIndex();
         // Clear search results
         $this->_resetSearchResults();
         $this->_updateMetadata();
         $this->_app->dispatchEvent('after_reindex_process_catalogsearch_index', array());
     } catch (Exception $e) {
         $this->_metadata->setInvalidStatus()->save();
         throw new Enterprise_Index_Model_Action_Exception($e->getMessage(), $e->getCode());
     }
     return $this;
 }