function drush_core_search_reindex

3.x search.drush.inc drush_core_search_reindex()
4.x search.drush.inc drush_core_search_reindex()

File

commands/core/search.drush.inc, line 68

Code

function drush_core_search_reindex() {
  drush_print(dt("The search index must be fully rebuilt before any new items can be indexed."));
  if (drush_get_option('immediate')) {
    drush_print(dt("Rebuilding the index may take a long time."));
  }
  if (!drush_confirm(dt('Do you really want to continue?'))) {
    return drush_user_abort();
  }

  if (drush_drupal_major_version() >= 7) {
    drush_op('search_reindex');
  }
  else {
    drush_op('search_wipe');
  }
  if (drush_get_option('immediate')) {
    drush_op('_drush_core_search_index');
    drush_log(dt('The search index has been rebuilt.'), 'ok');
  }
  else {
    drush_log(dt('The search index will be rebuilt.'), 'ok');
  }
}