You are here

function apachesolr_attachments_delete_index in Apache Solr Attachments 7

Same name and namespace in other branches
  1. 6.3 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()
  2. 6 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()
  3. 6.2 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()

See also

apachesolr_delete_index()

1 call to apachesolr_attachments_delete_index()
apachesolr_attachments_confirm_submit in ./apachesolr_attachments.admin.inc
Form submit handler for the index confirmation form

File

./apachesolr_attachments.admin.inc, line 306
Provides a file attachment search implementation for use with the Apache Solr module

Code

function apachesolr_attachments_delete_index() {
  try {
    $solr = apachesolr_get_solr();
    $solr
      ->deleteByQuery("entity_type:file AND hash:" . apachesolr_site_hash());
    module_load_include('inc', 'apachesolr', 'apachesolr.index');
    apachesolr_attachments_solr_reindex();
    return TRUE;
  } catch (Exception $e) {
    watchdog('Apache Solr Attachments', nl2br(check_plain($e
      ->getMessage())), NULL, WATCHDOG_ERROR);
  }
  return FALSE;
}