public function removeCategories($ids, $store_id = null) { $store_ids = Algolia_Algoliasearch_Helper_Entity_Helper::getStores($store_id); foreach ($store_ids as $store_id) { $index_name = $this->category_helper->getIndexName($store_id); $this->algolia_helper->deleteObjects($ids, $index_name); } }
public function removeCategories($ids, $store_id = null) { $store_ids = Algolia_Algoliasearch_Helper_Entity_Helper::getStores($store_id); foreach ($store_ids as $store_id) { if ($this->config->isEnabledBackEnd($store_id) === false) { $this->logger->log('INDEXING IS DISABLED FOR ' . $this->logger->getStoreName($store_id)); continue; } $index_name = $this->category_helper->getIndexName($store_id); $this->algolia_helper->deleteObjects($ids, $index_name); } }
public function rebuildProductIndex($storeId = null, $productIds = null) { $ids = Algolia_Algoliasearch_Helper_Entity_Helper::getStores($storeId); foreach ($ids as $id) { $by_page = $this->config->getNumberOfElementByPage(); if (is_array($productIds) && count($productIds) > $by_page) { foreach (array_chunk($productIds, $by_page) as $chunk) { $this->_rebuildProductIndex($id, $chunk); } } else { $this->_rebuildProductIndex($id, $productIds); } } return $this; }