You are here

function apachesolr_delete_index_confirm_submit in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 6 apachesolr.admin.inc \apachesolr_delete_index_confirm_submit()
  2. 6.2 apachesolr.admin.inc \apachesolr_delete_index_confirm_submit()

Submit function for the "Delete the index" confirmation form.

See also

apachesolr_delete_index_confirm()

File

./apachesolr.admin.inc, line 403
Administrative pages for the Apache Solr framework.

Code

function apachesolr_delete_index_confirm_submit($form_id, $form_values) {
  try {
    apachesolr_delete_index();

    // This form can't be seen by anyone without 'administer search'
    // permission, so no need to check perms before displaying a run-cron link.
    drupal_set_message(t('The Apache Solr content index has been erased. You must now !run_cron until your entire site has been re-indexed.', array(
      '!run_cron' => l(t('run cron'), 'admin/logs/status/run-cron', array(), 'destination=admin/settings/apachesolr/index'),
    )));
  } catch (Exception $e) {
    watchdog('Apache Solr', nl2br(check_plain($e
      ->getMessage())), WATCHDOG_ERROR);
  }
  return 'admin/settings/apachesolr/index';
}