我已经搜索了一段时间,遵循了这个答案,甚至查看了 shell 索引器脚本,我就带着这个来了。基本上,我有
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection();
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_MANUAL));
$processes->walk('save');
// Importing data here...
Mage::getModel('catalog/product_image')->clearCache();
// rebuild everything!!!
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection();
$processes->walk('reindexEverything');
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_REAL_TIME));
$processes->walk('save');
但我仍然在我的后端得到这个屏幕
...如何“更新”索引?
**更新**
问题解决了!
要正确索引所有内容,只需调用所有内容!
// rebuild everything!!!
$processes = Mage::getSingleton('index/indexer')->getProcessesCollection();
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_REAL_TIME));
$processes->walk('save');
$processes->walk('reindexAll');
$processes->walk('reindexEverything');