You are here

function hook_search_api_items_indexed in Search API 7

Same name and namespace in other branches
  1. 8 search_api.api.php \hook_search_api_items_indexed()

Allows modules to react after items were indexed.

Parameters

SearchApiIndex $index: The used index.

array $item_ids: An array containing the indexed items' IDs.

1 invocation of hook_search_api_items_indexed()
search_api_track_item_indexed in ./search_api.module
Marks items as successfully indexed for the specified index.

File

./search_api.api.php, line 327
Hooks provided by the Search API module.

Code

function hook_search_api_items_indexed(SearchApiIndex $index, array $item_ids) {
  if ($index
    ->getEntityType() == 'node') {

    // Flush page cache of the search page.
    cache_clear_all(url('search'), 'cache_page');
  }
}