You are here

public function Drupal_Apache_Solr_Service::clearCache in Apache Solr Search 6

Same name and namespace in other branches
  1. 5.2 Drupal_Apache_Solr_Service.php \Drupal_Apache_Solr_Service::clearCache()
  2. 6.2 Drupal_Apache_Solr_Service.php \Drupal_Apache_Solr_Service::clearCache()

Clear cached Solr data.

File

./Drupal_Apache_Solr_Service.php, line 161

Class

Drupal_Apache_Solr_Service

Code

public function clearCache() {

  // Don't clear cached data if the server is unavailable.
  if (@$this
    ->ping()) {
    $this
      ->_clearCache();
  }
  else {
    throw new Exception('No Solr instance available when trying to clear the cache.');
  }
}