5

My magento store has products around 30000.

Everytime When i upload/update new product, i have to reindex the whole store which takes very huge time.

So basically i would like to have a php script or any method which reindex all the indexes of a particular single product.

Is there any defined script/method to achieve?? please help.

  • @userpk colud you please explain how that script could be used for reindexing my choice of product – Guruprasad Mar 27 '17 at 5:45
1

@Guruprasad as per answer from @Vinai

You can simply pass the product object and process the selected event for single product

$product = Mage::getModel('catalog/product')->load('1'); // Product Id

$event = Mage::getSingleton('index/indexer')->logEvent(
        $product,
        $product->getResource()->getType(),
        Mage_Index_Model_Event::TYPE_SAVE,
        false
    );
    Mage::getSingleton('index/indexer')
        ->getProcessByCode('catalog_url') // Adjust the indexer process code as needed
        ->setMode(Mage_Index_Model_Process::MODE_REAL_TIME)
        ->processEvent($event);
  • so do i have to run this script as a php file? – Guruprasad Mar 27 '17 at 6:55
  • 1
    This depends on you. You can run via observer on product save after and place this code. Or if you want to run as cron. What ever your requirement is. – Priyank Mar 27 '17 at 7:01
1

Login in admin panel

Go to System->Index Management

click on Select all

click Actions dropdown and set Change Index Mode

the other dropdown will appears and set Update on Save in other dropdown.

and click on submit button.

  • i asked for a solution where in i want solution for reindexing a single product, your solution will apply for all products. – Guruprasad Mar 27 '17 at 5:26
  • @Guruprasad, when you set this settings index fires on save – Murtuza Zabuawala Mar 27 '17 at 5:35
  • i know that would trigger reindex on save. But my requirement is not to generalize that to all products. I just want a single product to reindex of my required – Guruprasad Mar 27 '17 at 5:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.