You are here

public function SearchApiElasticsearchConnectorMissing::indexItems in Elasticsearch Connector 7.2

Same name and namespace in other branches
  1. 7.5 modules/elasticsearch_connector_search_api/service.inc \SearchApiElasticsearchConnectorMissing::indexItems()
  2. 7 modules/elasticsearch_connector_search_api/service.inc \SearchApiElasticsearchConnectorMissing::indexItems()

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

modules/elasticsearch_connector_search_api/service.inc, line 19
Provides a Elasticsearch-based service class for the Search API using Elasticsearch Connector module.

Class

SearchApiElasticsearchConnectorMissing
Dummy search service for when the ElasticSearch library isn't available.

Code

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