在后台System -> Index Management,我们可以手动进行reindex,其实呢,使用代码也是可以方便的进行reindex的。
进入System -> Index Management,假设共有以下项目:
1. Product Attributes
2. Product Prices
3. Catalog URL Rewrites
4. Product Flat Data
5. Category Flat Data
6. Category Products
7. Catalog Search index
8. Tag Aggregation Data
9. Stock Status
如果想对Product Flat Data reindex,按照以下步骤,将load参数设为4,
注:将鼠标移到这些项目上,从url提示可以确认参数值。
- $process = Mage::getModel('index/process')->load(4);
- $process->reindexAll();
如果想对所有项目reindex,请使用以下方式:
- for ($i = 1; $i <= 9; $i++) {
- $process = Mage::getModel('index/process')->load($i);
- $process->reindexAll();
- }
(看index_process表)
更多精彩内容:各种AI课程、技能课程、黑科技软件、网站小程序源码、副业小项目、PPT模板等精品素材、电商课程、推广引流课程等,尽在 天边资源网 。