You are here

public function SearchApiSolrService::createId in Search API Solr 7

Creates an ID used as the unique identifier at the Solr server.

This has to consist of both index and item ID. Optionally, the site hash is also included.

Parameters

string $index_id: The search index's machine name.

mixed $item_id: The Search API item ID of the item.

Return value

string The Solr ID to use for this item.

See also

search_api_solr_site_hash()

5 calls to SearchApiSolrService::createId()
SearchApiSolrService::deleteItems in includes/service.inc
Implements SearchApiServiceInterface::deleteItems().
SearchApiSolrService::extractResults in includes/service.inc
Extract results from a Solr response.
SearchApiSolrService::indexItems in includes/service.inc
Indexes the specified items.
SearchApiSolrService::search in includes/service.inc
Executes a search on the server represented by this object.
SearchApiSolrService::searchMultiple in includes/service.inc
Implements SearchApiMultiServiceInterface::searchMultiple().

File

includes/service.inc, line 694

Class

SearchApiSolrService
Search service class using Solr server.

Code

public function createId($index_id, $item_id) {
  $site_hash = !empty($this->options['site_hash']) ? search_api_solr_site_hash() . '-' : '';
  return "{$site_hash}{$index_id}-{$item_id}";
}