function apachesolr_attachments_delete_index in Apache Solr Attachments 6.2
Same name and namespace in other branches
- 6.3 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()
- 6 apachesolr_attachments.admin.inc \apachesolr_attachments_delete_index()
- 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 
- Form submit handler for the index confirmation form
File
- ./apachesolr_attachments.admin.inc, line 220 
- 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_set_last_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;
}