You are here

protected function SearchApiSolrBackend::getIndexId in Search API Solr 8

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.2 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::getIndexId()
  3. 4.x 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 "search_api_solr.settings.index_prefix" configuration.
  • If set, the index-specific "search_api_solr.settings.index_prefix_INDEX" configuration.
  • The index's machine name.

Parameters

string $machine_name: The index's machine name.

Return value

string The prefixed machine name.

4 calls to SearchApiSolrBackend::getIndexId()
SearchApiSolrBackend::deleteAllIndexItems in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Deletes all the items from the index.
SearchApiSolrBackend::deleteItems in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Deletes the specified items from the index.
SearchApiSolrBackend::getDocuments in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Retrieves Solr documents from search api index items.
SearchApiSolrBackend::search in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Options on $query prefixed by 'solr_param_' will be passed natively to Solr as query parameter without the prefix. For example you can set the "Minimum Should Match" parameter 'mm' to '75%' like this:

File

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

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

protected function getIndexId($machine_name) {

  // Prepend per-index prefix.
  $id = $this->searchApiSolrSettings
    ->get('index_prefix_' . $machine_name) . $machine_name;

  // Prepend environment prefix.
  $id = $this->searchApiSolrSettings
    ->get('index_prefix') . $id;
  return $id;
}