Magento

How to add indexer in a Custom Module?

Follow these steps:

config.xml:

<index>                       

<indexer>

<cms_indexer>

<model>module/cmsindexer</model>

</cms_indexer>

</indexer>

</index>

Model:

app/code/local/Name/Module/Model/Cmsindexer.php

Class Module_Model_CmsIndexer extends Mage_Index_Model_Indexer_Abstract

{

public function getName(){

return ‘Add CMS Cache’;

}

public function getDescription(){

return ‘Rebuild Cache Index for all CMS Pages’;

}

protected function _processEvent(Mage_Index_Model_Event $event){

// process

}

public function reindexAll(){

//Your Function to be executed

}

?>

You Might Also Like