/** * Rebuild all index data */ public function reindexAll() { if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || !$this->config->getSearchOnlyAPIKey()) { Mage::getSingleton('adminhtml/session')->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.'); return; } $this->engine->rebuildSuggestions(); return $this; }
/** * Rebuild all index data. */ public function reindexAll() { if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || !$this->config->getSearchOnlyAPIKey()) { /** @var Mage_Adminhtml_Model_Session $session */ $session = Mage::getSingleton('adminhtml/session'); $session->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.'); return; } $this->engine->rebuildAdditionalSections(); return $this; }
/** * 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. * * @param array|string|int $updateProductIds */ 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); } }
/** * 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; }
/** * Rebuild all index data */ public function reindexAll() { if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || !$this->config->getSearchOnlyAPIKey()) { Mage::getSingleton('adminhtml/session')->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.'); $this->logger->log('ERROR Credentials not configured correctly'); return; } $this->logger->start('PRODUCTS FULL REINDEX'); $this->engine->rebuildProducts(); $this->logger->stop('PRODUCTS FULL REINDEX'); return $this; }