/** * Rebuild index for the specified products * * @param null|int $storeId * @param null|int|array $productIds * @return Algolia_Algoliasearch_Model_Resource_Fulltext */ public function rebuildProductIndex($storeId = NULL, $productIds = NULL) { if ($this->_helper->isEnabled($storeId) && is_object($this->_engine) && is_callable(array($this->_engine, 'rebuildProductIndex'))) { $this->_engine->rebuildProductIndex($storeId, $productIds); } return $this; }
/** * Define if engine is available * * @return bool */ public function test() { if (!$this->_helper->isEnabled()) { return parent::test(); } return $this->_helper->getApplicationID() && $this->_helper->getAPIKey() && $this->_helper->getSearchOnlyAPIKey(); }
/** * Retrieve root category id * * @return int */ public function getRootCategoryId() { if (-1 === self::$_rootCategoryId) { $collection = Mage::getResourceModel('catalog/category_collection'); $collection->addFieldToFilter('parent_id', 0); $collection->getSelect()->limit(1); $rootCategory = $collection->getFirstItem(); self::$_rootCategoryId = $rootCategory->getId(); } return self::$_rootCategoryId; }
public function moveProductsTmpIndex(Varien_Object $event) { $storeId = $event->getStoreId(); $this->helper->moveProductsIndex($storeId); }