I have made a module that adds a grouped product to the catalog. After adding some products I always have to reindex to see the changes. If I add a product via the Admin, this does not seem to be necessary.
Is there a way to only update the indexes for the added product instead of having to update all product indexes?
I have pasted the code I use to add a product below:
$product = $this->objectManager->create('\Magento\Catalog\Model\Product'); $product->setSku($iceProduct['sku']) // Set your sku here ->setName($iceProduct['title']); // Name of Product ->setDescription($iceProduct['descr_long']); // Name of Product //enz... ->save();