If you want to reindex your magento index management programmatically than simple follow below step.
For Product Attributes
$reindex = Mage::getModel('index/process')->load(1);
$reindex ->reindexAll();
For Product Prices
$reindex = Mage::getModel('index/process')->load(2);
$reindex ->reindexAll();
For Catalog URL Rewrites
$reindex = Mage::getModel('index/process')->load(3);
$reindex ->reindexAll();
For Product Flat Data
$reindex = Mage::getModel('index/process')->load(4);
$reindex ->reindexAll();
For Category Flat Data
$reindex = Mage::getModel('index/process')->load(5);
$reindex ->reindexAll();
For Category Products
$reindex = Mage::getModel('index/process')->load(6);
$reindex ->reindexAll();
For Catalog Search Index
$reindex = Mage::getModel('index/process')->load(7);
$reindex ->reindexAll();
For Stock Status
$reindex = Mage::getModel('index/process')->load(8);
$reindex ->reindexAll();
For Tag Aggregation Data
$reindex = Mage::getModel('index/process')->load(9);
$reindex ->reindexAll();
OR
if you want all index than use below code.
for ($ga = 1; $ga <= 9; $ga++) {
$reindex = Mage::getModel('index/process')->load($ga);
$reindex ->reindexAll();
}
For Product Attributes
$reindex = Mage::getModel('index/process')->load(1);
$reindex ->reindexAll();
For Product Prices
$reindex = Mage::getModel('index/process')->load(2);
$reindex ->reindexAll();
For Catalog URL Rewrites
$reindex = Mage::getModel('index/process')->load(3);
$reindex ->reindexAll();
For Product Flat Data
$reindex = Mage::getModel('index/process')->load(4);
$reindex ->reindexAll();
For Category Flat Data
$reindex = Mage::getModel('index/process')->load(5);
$reindex ->reindexAll();
For Category Products
$reindex = Mage::getModel('index/process')->load(6);
$reindex ->reindexAll();
For Catalog Search Index
$reindex = Mage::getModel('index/process')->load(7);
$reindex ->reindexAll();
For Stock Status
$reindex = Mage::getModel('index/process')->load(8);
$reindex ->reindexAll();
For Tag Aggregation Data
$reindex = Mage::getModel('index/process')->load(9);
$reindex ->reindexAll();
OR
if you want all index than use below code.
for ($ga = 1; $ga <= 9; $ga++) {
$reindex = Mage::getModel('index/process')->load($ga);
$reindex ->reindexAll();
}
No comments:
Post a Comment