0

I am using an import script to import all my products from a custom file and after each import I reindex all the indices like this:

try {

    // @var $indexCollection Mage_Index_Model_Resource_Process_Collection
    $indexCollection = Mage::getModel('index/process')->getCollection();
    foreach ($indexCollection as $index) {
        // @var $index Mage_Index_Model_Process
        $index->reindexAll();
    }

} catch(Exception $e) {
    Mage::log('Import: Reindex failed.');
}

but during this process the magento search is not working and returns that products could not be found. Is this the default behaviour of magento or can I fix this?

I synchronize my products many times each day so it is not so great, if the search is not working at this time. Hope you can help me :).

3
  • i think you have to refer this magento.stackexchange.com/q/103037/45103 Commented Dec 4, 2016 at 14:44
  • the solution of the suggested article is reindexing via cronjob, but in my case I thought the reindex process after an import is causing the problem, anyway I have removed the reindexing code from my import script and I have created a new script for reindexing which will only be fired second times each day by a cronjob
    – Fox
    Commented Dec 4, 2016 at 22:07
  • Yes exactly I want to direct you in that way only. Once in a day reindexing is more optimal than every time Commented Dec 5, 2016 at 5:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.