You are here

function apachesolr_attachments_delete_index in Apache Solr Attachments 6

Same name and namespace in other branches
  1. 6.3 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()
  2. 6.2 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()
  3. 7 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()
1 call to apachesolr_attachments_delete_index()
apachesolr_attachments_confirm_submit in ./apachesolr_attachments.admin.inc

File

./apachesolr_attachments.admin.inc, line 205
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:file AND hash:" . apachesolr_site_hash());
    $solr
      ->commit();
    apachesolr_index_updated(time());
    apachesolr_clear_last_index('apachesolr_attachments');
    return TRUE;
  } catch (Exception $e) {

    // Shortened project name because the watchdog limits type to 16 characters.
    watchdog('ApacheSolrAttach', nl2br(check_plain($e
      ->getMessage())), NULL, WATCHDOG_ERROR);
  }
  return FALSE;
}