You are here

protected function SearchApiSolrBackend::createId in Search API Solr 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::createId()
  2. 8.2 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::createId()
  3. 4.x src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::createId()

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 $site_hash: The site hash.

string $index_id: The index ID.

string|int $item_id: The item ID.

Return value

string A unique identifier for the given item.

4 calls to SearchApiSolrBackend::createId()
SearchApiSolrBackend::deleteItems in src/Plugin/search_api/backend/SearchApiSolrBackend.php
SearchApiSolrBackend::extractResults in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Extract results from a Solr response.
SearchApiSolrBackend::getDocuments in src/Plugin/search_api/backend/SearchApiSolrBackend.php
SearchApiSolrBackend::getMoreLikeThisQuery in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Changes the query to a "More Like This" query.

File

src/Plugin/search_api/backend/SearchApiSolrBackend.php, line 1910

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

protected function createId($site_hash, $index_id, $item_id) {
  return "{$site_hash}-{$index_id}-{$item_id}";
}