/** * This method sets the full text search to available when a scheduled FTS Index occurs. * An indexing can only occur with a valid connection * * TODO: XXX Fix this to use admin settings not config options * @return bool */ protected function setFTSUp() { $cfg = new Configurator(); $cfg->config['fts_disable_notification'] = false; $cfg->handleOverride(); // set it up SugarSearchEngineAbstractBase::markSearchEngineStatus(false); $admin = BeanFactory::newBean('Administration'); $admin->retrieveSettings(FALSE, TRUE); return TRUE; }
sugar_die("silentFTSIndex.php is CLI only.\n"); } if (empty($current_language)) { $current_language = $sugar_config['default_language']; } $app_list_strings = return_app_list_strings_language($current_language); $app_strings = return_application_language($current_language); global $current_user; $current_user = BeanFactory::getBean('Users'); $current_user->getSystemUser(); // Pop off the filename array_shift($argv); // Don't wipe the index if we're just doing individual modules $clearData = empty($argv); // Allows for php -f silentFTSIndex.php Bugs Cases $modules = $argv; require_once 'include/SugarSearchEngine/SugarSearchEngineFullIndexer.php'; require_once 'include/SugarSearchEngine/SugarSearchEngineAbstractBase.php'; try { SugarSearchEngineAbstractBase::markSearchEngineStatus(false); // set search engine to "up" $indexer = new SugarSearchEngineFullIndexer(); if (!$indexer->performFullSystemIndex($modules, $clearData)) { echo "FTS index failed. Please check the sugarcrm.log for more details.\n"; exit(1); } } catch (Exception $e) { echo "Exception: " . $e->getMessage() . "\n"; exit(1); } exit(0);
/** * Check FTS server status and update cache file and notification. * * @return boolean */ protected function updateFTSServerStatus() { $GLOBALS['log']->debug('Going to check and update FTS Server status.'); // check FTS server status $result = $this->SSEngine->getServerStatus(); if ($result['valid']) { $GLOBALS['log']->debug('FTS Server is OK.'); // server is ok if (SugarSearchEngineAbstractBase::isSearchEngineDown()) { $GLOBALS['log']->debug('Restoring FTS Server status.'); // mark fts server as up SugarSearchEngineAbstractBase::markSearchEngineStatus(false); // remove notification $cfg = new Configurator(); $cfg->config['fts_disable_notification'] = false; $cfg->handleOverride(); } return true; } else { $GLOBALS['log']->info('FTS Server is down?'); // server is down if (!SugarSearchEngineAbstractBase::isSearchEngineDown()) { $GLOBALS['log']->fatal('Marking FTS Server as down.'); // fts is not marked as down, so mark it as down SugarSearchEngineAbstractBase::markSearchEngineStatus(true); } return false; } }