You are here

function apachesolr_delete_index_form in Apache Solr Search 5.2

Same name and namespace in other branches
  1. 5 apachesolr.module \apachesolr_delete_index_form()
  2. 6 apachesolr.admin.inc \apachesolr_delete_index_form()

Create a form for deleting the contents of the Solr index.

2 string references to 'apachesolr_delete_index_form'
apachesolr_index_page in ./apachesolr.admin.inc
Gets information about the fields already in solr index.
apachesolr_search_form_alter in ./apachesolr_search.module
Implementation of hook_form_alter().

File

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

Code

function apachesolr_delete_index_form() {
  $form = array();
  $form['markup'] = array(
    '#prefix' => '<h3>',
    '#value' => t('Index controls'),
    '#suffix' => '</h3>',
  );
  $form['toggle_index'] = array(
    '#type' => 'submit',
    '#value' => variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE) ? t('Start indexer') : t('Pause indexer'),
  );
  $form['toggle_index-desc'] = array(
    '#type' => 'item',
    '#description' => variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE) ? t('The indexer is paused. You can restart it by clicking on this button. The indexing process will start on next cron run.') : t('The indexer is started and it runs on cron. You can pause the indexer by clicking on this button.'),
  );
  $form['reindex'] = array(
    '#type' => 'submit',
    '#value' => t('Re-index all content'),
    '#disabled' => (bool) variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE),
  );
  $form['reindex-desc'] = array(
    '#type' => 'item',
    '#description' => t('Re-indexing will add all content to the index again (overwriting the index), but existing content in the index will remain searchable.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Delete the index'),
    '#disabled' => (bool) variable_get('apachesolr_read_only', APACHESOLR_READ_WRITE),
  );
  $form['delete-desc'] = array(
    '#type' => 'item',
    '#description' => t('Deletes all of the documents in the Solr index. This is rarely necessary unless your index is corrupt or you have installed a new schema.xml.'),
  );
  return $form;
}