You are here

public function SearchApiSolrBackend::getIndexId in Search API Solr 4.x

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

Prefixes an index ID as configured.

The resulting ID will be a concatenation of the following strings:

  • If set, the server-specific index_prefix.
  • If set, the index-specific prefix.
  • The index's machine name.

Parameters

\Drupal\search_api\IndexInterface $index: The Search API index entity.

Return value

string The prefixed machine name.

Overrides SolrBackendInterface::getIndexId

1 call to SearchApiSolrBackend::getIndexId()
SearchApiSolrBackend::getTargetedIndexId in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Returns the targeted Index ID. In case of multisite it might differ.

File

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

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

public function getIndexId(IndexInterface $index) {
  $settings = Utility::getIndexSolrSettings($index);
  return $this->configuration['server_prefix'] . $settings['advanced']['index_prefix'] . $index
    ->id();
}