Algolia_Algoliasearch_Model_Indexer_Abstract::reindexSpecificProducts PHP Method

reindexSpecificProducts() public method

This function will update all the requested products and their parent products in Algolia. You can provide either a single product ID or an array of product IDs. A product ID should be either a string or an integer.
public reindexSpecificProducts ( array | string | integer $updateProductIds )
$updateProductIds array | string | integer
    public function reindexSpecificProducts($updateProductIds)
    {
        $updateProductIds = (array) $updateProductIds;
        $productIds = $updateProductIds;
        foreach ($updateProductIds as $updateProductId) {
            if (!$this->_isProductComposite($updateProductId)) {
                $parentIds = $this->_getResource()->getRelationsByChild($updateProductId);
                if (!empty($parentIds)) {
                    $productIds = array_merge($productIds, $parentIds);
                }
            }
        }
        if (!empty($productIds)) {
            $this->engine->rebuildProductIndex(null, $productIds);
        }
    }