Skip to content

Instantly share code, notes, and snippets.

@danlamanna
Created May 3, 2012 21:10
Show Gist options
  • Save danlamanna/2589535 to your computer and use it in GitHub Desktop.
Save danlamanna/2589535 to your computer and use it in GitHub Desktop.
Programatically Re-indexing Magento Indexes
<?php
// Specifically getting catalog_url indexer, returns Mage_Index_Model_Process
$catalog_url_rewrite_process = Mage::getSingleton('index/indexer')->getProcessesCollection()
->addFieldToFilter('indexer_code', 'catalog_url')
->getFirstItem();
// Can use reindexAll(), or reindexEverything which checks dependencies, and returns reindexAll()
$catalog_url_rewrite_process->reindexEverything();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment