You are here

function search_api_track_item_change in Search API 7

Mark the items with the specified IDs as "dirty", i.e., as needing to be reindexed.

For indexes for which items should be indexed immediately, the items are indexed directly, instead.

Parameters

$type: The type of items, specific to the data source.

array $item_ids: The IDs of the items to be marked dirty.

3 calls to search_api_track_item_change()
drush_search_api_reindex_items in ./search_api.drush.inc
Marks the given entities as needing to be re-indexed.
search_api_entity_update in ./search_api.module
Implements hook_entity_update().
_search_api_rules_action_index in ./search_api.rules.inc
Rules action for indexing an item.

File

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

Code

function search_api_track_item_change($type, array $item_ids) {
  $conditions = array(
    'enabled' => 1,
    'item_type' => $type,
    'read_only' => 0,
  );
  $indexes = search_api_index_load_multiple(FALSE, $conditions);
  if (!$indexes) {
    return;
  }
  search_api_track_item_change_for_indexes($type, $item_ids, $indexes);
}