0

New to Magento2, I am trying to use the Indexer to reindexAll.

I tried with the objectManager, without success.

Sample :

$indexer  = $this->objectManager->create('Magento\Indexer\Model\Indexer');

$ret = $indexer->reindexAll();

[InvalidArgumentException] view does not exist.

How can I get this ? Any tips, or docs will be great.

0

I found code this code in my improved reindex module: https://mirasvit.com/magento-2-extensions/improved-asynchronous-reindex.html

$indexerIds = [<ids>];
$indexRegistry = $this->objectManager->create('Magento\Framework\Indexer\IndexerRegistry');
foreach ($indexerIds as $indexerId) {
    $indexer = $indexRegistry->get($indexerId);
    $indexer->reindexAll();
}
  • cataloginventory_stock catalogrule_product catalogrule_rule catalogsearch_fulltext catalog_category_product catalog_product_attribute catalog_product_category catalog_product_price customer_grid design_config_grid – Alex Sep 15 '17 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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