/** * This controller action is used to build the search index. */ public function buildAction() { @set_time_limit(1200); $adapter = new Shopware_Components_Search_Adapter_Default(Shopware()->Db(), Shopware()->Cache(), new Shopware_Components_Search_Result_Default(), Shopware()->Config()); $adapter->buildSearchIndex(); $this->View()->assign(array('success' => true)); }
/** * Recreate shopware search index * * @param Shopware_Components_Cron_CronJob $job * @return void */ public function onCronJobSearch(Shopware_Components_Cron_CronJob $job) { $adapter = Enlight()->Events()->filter('Shopware_Controllers_Frontend_Search_SelectAdapter', null); if (empty($adapter)) { $adapter = new Shopware_Components_Search_Adapter_Default(Shopware()->Db(), Shopware()->Cache(), new Shopware_Components_Search_Result_Default(), Shopware()->Config()); } //$adapter = new Shopware_Components_Search_Adapter_Default(Shopware()->Db(), Shopware()->Cache(), new Shopware_Components_Search_Result_Default(), Shopware()->Config()); $adapter->buildSearchIndex(); }
/** * Event listener function of the search index rebuild cron job. * @param Enlight_Event_EventArgs $arguments * @return bool */ public function refreshSearchIndex(Enlight_Event_EventArgs $arguments) { $strategy = Shopware()->Config()->get('searchRefreshStrategy', self::STRATEGY_LIVE); if ($strategy !== self::STRATEGY_CRON_JOB) { return true; } $adapter = new Shopware_Components_Search_Adapter_Default(Shopware()->Db(), Shopware()->Cache(), new Shopware_Components_Search_Result_Default(), Shopware()->Config()); $adapter->buildSearchIndex(); return true; }