Skip to content

Commit

Permalink
MDL-53247 search: Require search to be available before running index…
Browse files Browse the repository at this point in the history
…er script
  • Loading branch information
David Monllao committed Mar 9, 2016
1 parent f758ad3 commit ee72a4d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions search/cli/indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@
cli_error('Global search is disabled. Use --force if you want to force an index while disabled');
}

if (!$searchengine = \core_search\manager::search_engine_instance()) {
cli_error(get_string('engineserverstatus', 'search'));
}
if (!$searchengine->is_installed()) {
cli_error('enginenotinstalled', 'search', $CFG->searchengine);
}
$serverstatus = $searchengine->is_server_ready();
if ($serverstatus !== true) {
cli_error($serverstatus);
}

$globalsearch = \core_search\manager::instance();

if (empty($options['reindex'])) {
Expand Down

0 comments on commit ee72a4d

Please sign in to comment.