You are here

function search_api_search_api_index_delete in Search API 7

Implements hook_search_api_index_delete().

Removes all data for indexes not available any more.

1 string reference to 'search_api_search_api_index_delete'
search_api_search_api_index_insert in ./search_api.module
Implements hook_search_api_index_insert().

File

./search_api.module, line 744
Provides a flexible framework for implementing search services.

Code

function search_api_search_api_index_delete(SearchApiIndex $index) {

  // Only react on real delete, not revert.
  if ($index
    ->hasStatus(ENTITY_IN_CODE)) {
    $reverts =& drupal_static(__FUNCTION__, array());
    $reverts[$index->machine_name] = $index;
    return;
  }
  cache_clear_all($index
    ->getCacheId(''), 'cache', TRUE);
  $index
    ->postDelete();
}