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.

1 Answer 1

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();
}
1
  • 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, 2017 at 11:00

Your Answer

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

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