You are here

function search_api_get_items_to_index in Search API 7

Returns a list of items that need to be indexed for the specified index.

Parameters

SearchApiIndex $index: The index for which items should be retrieved.

$limit: The maximum number of items to retrieve. -1 means no limit.

Return value

array An array of IDs of items that need to be indexed.

1 call to search_api_get_items_to_index()
search_api_index_items in ./search_api.module
Indexes items for the specified index.

File

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

Code

function search_api_get_items_to_index(SearchApiIndex $index, $limit = -1) {
  if ($limit == 0) {
    return array();
  }
  return $index
    ->datasource()
    ->getChangedItems($index, $limit);
}