2013-09-26 129 views
4

如何在“库存状态”和“目录产品价格”中手动重新编制索引magento ee 1.13.0.2企业版Magento reindex问题

其实我已经试图与

$process = Mage::getModel('index/indexer')->getProcessByCode('catalog_product_price'); 
$process->reindexAll(); 

,但它并不会导致我的预期。由MySQL触发

+0

也许你可以:

$client = Mage::getModel('enterprise_mview/client'); $client->init('catalog_product_index_price'); $metadata = $client->getMetadata(); $metadata->setInvalidStatus(); $metadata->save(); 

的新的索引系统说明reindex使用shell命令? – Ansyori

回答

-2
$process = Mage::getSingleton('index/indexer')->getProcessById(2); 

$process = Mage::getSingleton('index/indexer')->getProcessByCode('catalog_product_price'); 

,或者尝试$process->reindexEverything();

Process Name  ID   Code 
Product Attributes  1  catalog_product_attribute 
Product Prices   2  catalog_product_price 
Catalog URL Rewrites 3  catalog_url 
Product Flat Data  4  catalog_product_flat 
Category Flat Data  5  catalog_category_flat 
Category Products  6  catalog_category_product 
Catalog Search Index 7  catalogsearch_stock 
Stock Status   8  cataloginventory_stock 
Tag Aggregation Data 9  tag_summary 
+0

感谢马丁,我也试过这个代码,但在EE 1.13.0.2它不工作。 – Akash

-2

在magetno 1.13.0.2将重新编制完成全自动。 只有你需要 - 为magento设置cronjob。

对于测试,你可以运行http://yousite.com/cron.php手动

3

我已经在这个自己前几天偶然。 EE中的索引已被彻底改写,这就是为什么旧式reindexing不起作用。你不能随意重新索引了,而是你可以安排你重新索引所以接下来的cron作业将在后台为你做:http://www.eschrade.com/page/indexing-in-magento-or-the-wonderful-world-of-materialized-views/

+1

从技术上讲,如果cron-job能够完成一个完整的重新索引,那么Magento 1 API中也有一些代码可以做到这一点。只是说,你在这里回答的是正确的,在EE中通常没有完全重新索引(必要),并且MySql触发器应该自动处理(与always cron一起)。 – hakre