You are here

public function SearchApiElasticsearchBackend::getIndexName in Elasticsearch Connector 8

Helper function. Returns the elasticsearch name of an index.

2 calls to SearchApiElasticsearchBackend::getIndexName()
SearchApiElasticsearchBackend::addIndex in src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
Overrides addIndex().
SearchApiElasticsearchBackend::getIndexParam in src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php
Helper function to return the index param.

File

src/Plugin/search_api/backend/SearchApiElasticsearchBackend.php, line 900
Contains the SearchApiElasticsearchBackend object.

Class

SearchApiElasticsearchBackend
Plugin annotation @SearchApiBackend( id = "elasticsearch", label = @Translation("Elasticsearch"), description = @Translation("Index items using an Elasticsearch server.") )

Namespace

Drupal\elasticsearch_connector\Plugin\search_api\backend

Code

public function getIndexName(IndexInterface $index) {
  global $databases;
  $site_database = $databases['default']['default']['database'];
  $index_machine_name = is_string($index) ? $index : $index
    ->id();
  return self::escapeName('elasticsearch_index_' . $site_database . '_' . $index_machine_name);
}