Skip to content

Instantly share code, notes, and snippets.

@gamort
Created February 13, 2017 19:01
Show Gist options
  • Save gamort/5dc5e16bdec00a8bb3b922fc463af17c to your computer and use it in GitHub Desktop.
Save gamort/5dc5e16bdec00a8bb3b922fc463af17c to your computer and use it in GitHub Desktop.
Forces Magento EE to reindex all products
<?php
require_once __DIR__ . "/../app/Mage.php";
Mage::app();
$tables = [
'catalog_category_product_cat',
'catalog_category_product_index',
'cataloginventory_stock_status',
'catalog_product_index_price'
];
foreach ($tables as $table) {
/* @var $client Enterprise_Mview_Model_Client */
$client = Mage::getModel('enterprise_mview/client');
$client->init($table);
$metadata = $client->getMetadata();
$metadata->setInvalidStatus();
$metadata->setVersionId('');
$metadata->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment