Skip to content

Instantly share code, notes, and snippets.

@gelanivishal
Last active February 21, 2017 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gelanivishal/3cd240753668db9d4987e4fea433382c to your computer and use it in GitHub Desktop.
Save gelanivishal/3cd240753668db9d4987e4fea433382c to your computer and use it in GitHub Desktop.
Clear cache/reindex
<?php
include 'app/Mage.php';
Mage::app();
// clear cache
Mage::app()->removeCache('catalog_rules_dirty');
// reindex prices
Mage::getModel('index/process')->load(2)->reindexEverything();
/*
1 = Product Attributes
2 = Product Attributes
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
*/
// Recreate a single index programmatically
Mage::getModel('index/process')->load(Mage_Catalog_Helper_Product_Flat::CATALOG_FLAT_PROCESS_CODE, 'indexer_code')->reindexEverything();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment