What is the proper way to reindex a single item after modifications have been made to it.
Example context:
Our company relies on a third party inventory management platform called Stone Edge. We also sell items on multiple storefronts those include Magento, Amazon, Ebay and Buy.com
Once every 10 minutes Stone Edge will download all orders from the sites and then send the inventory adjustments back to our Magento store. This is done by sending a simple http request to a php script stored on our webserver with an array of key value pairs for each of the items in inventory that have had an inventory change since the last update.
After the save function is completed on each of these, the item is then re-indexed so as not to reflect a 0 inventory in-between the time of the update and the next sitewide re-index.
I've located on the Magento forums discussion about how to re-index the item:
$item->setForceReindexRequired(true);
Mage::getSingleton('index/indexer')->processEntityAction($item,Mage_CatalogInventory_Model_Stock_Item::ENTITY,Mage_Index_Model_Event::TYPE_SAVE);
Prior to this set of instructions you would see something like
$item = Mage::getModel('cataloginventory/stock_item')->loadByProduct($entityid);
$item->addQty($change);
$item->save();
However, after completing this, a problem became apparent. The items themselves were re-indexed, but if they were a member of a grouped product, then the group product was not updated.
There is an obvious issue that I will need to address. What is the best approach to this problem?
I will post an answer if I happen to come up with one.