Sharing some useful tips, solutions and notes for Geeks.

Tuesday, November 19, 2019

Reindex Magento 2 programatically

To reindex a specific indexer, please use below


use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$obj = $bootstrap->getObjectManager();
$indexer = $obj->get('Magento\Framework\Indexer\IndexerRegistry')->get('design_config_grid');
$indexer->reindexAll();



Above code wll reindex design_config_grid indexer

No comments: