Q:

Programmatically run single product indexing in magento EE 1.14

I want to reindex single product via programmatically. As i know, in enterprises edition there is update on save mode for product. It re-indexed the single product added via UI ( From admin ).
Is there any way to re-index single product programmatically ? 
Also can anybody explain how reindex works on "Update on save" mode.
Any help would be appreciated  !
Thanks in advance

A:

After lot of debugging, i found the sound code which does reindex product by product id.  Here is the way -  
require_once('app/Mage.php');
umask(0);
Mage::app();
// Get products
$productsIds = array('11','222','3333'); // product id array

// Reindex category/product association
$event = Mage::getModel('index/event');
$event->setNewData(array(
    'product_ids' => &$productsIds // for category_indexer_product
));
Mage::getResourceSingleton('catalog/category_indexer_product')->catalogProductMassAction($event);

// Reindex prices
Mage::getResourceModel('catalog/product_indexer_price')->reindexProductIds($productsIds);

// Reindex stock
Mage::getResourceModel('cataloginventory/indexer_stock')->reindexProducts($productsIds);

// Reindex attributes
Mage::getResourceModel('catalog/product_indexer_eav_source')->reindexEntities($productsIds);

// Reindex fulltext
$catalogSearchIndexer = Mage::getResourceModel('catalogsearch/fulltext');
$catalogSearchIndexer->rebuildIndex(null, $productsIds);

Cheers !!!

