You are here

function _search_api_index_queued_items in Search API 7

Shutdown function which indexes all queued items, if any.

1 string reference to '_search_api_index_queued_items'
search_api_index_specific_items_delayed in ./search_api.module
Queues items for indexing at the end of the page request.

File

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

Code

function _search_api_index_queued_items() {
  $queue =& search_api_index_specific_items_delayed();
  try {
    if ($queue) {
      $indexes = search_api_index_load_multiple(array_keys($queue));
      foreach ($indexes as $index_id => $index) {
        if ($index->enabled && !$index->read_only) {
          search_api_index_specific_items($index, $queue[$index_id]);
        }
      }
    }

    // Reset the queue so we don't index the items twice by accident.
    $queue = array();
  } catch (SearchApiException $e) {
    watchdog_exception('search_api', $e);
  }
}