You are here

public function SearchApiDummyService::indexItems in Search API 7

Indexes the specified items.

Parameters

SearchApiIndex $index: The search index for which items should be indexed.

array $items: An array of items to be indexed, keyed by their id. The values are associative arrays of the fields to be stored, where each field is an array with the following keys:

  • type: One of the data types recognized by the Search API, or the special type "tokens" for fulltext fields.
  • original_type: The original type of the property, as defined by the datasource controller for the index's item type.
  • value: The value to index.

The special field "search_api_language" contains the item's language and should always be indexed.

The value of fields with the "tokens" type is an array of tokens. Each token is an array containing the following keys:

  • value: The word that the token represents.
  • score: A score for the importance of that word.

Return value

array An array of the ids of all items that were successfully indexed.

Throws

SearchApiException If indexing was prevented by a fundamental configuration error.

Overrides SearchApiServiceInterface::indexItems

File

tests/search_api_test_2.module, line 114
Provides a second test service and server for testing Search API.

Class

SearchApiDummyService
Dummy service for testing.

Code

public function indexItems(SearchApiIndex $index, array $items) {
  return array();
}