You are here

protected function SearchApiElasticsearchAbstractService::getIndexName in Search API Elasticsearch 7

Helper function. Returns the elasticsearch name of an index.

1 call to SearchApiElasticsearchAbstractService::getIndexName()
SearchApiElasticsearchElastica::getElasticaIndex in modules/elastica/includes/SearchApiElasticsearchElastica.inc
Helper function. Get an Elastica index.

File

includes/SearchApiElasticsearchAbstractService.inc, line 944
Provides a Elasticsearch-based service class for the Search API.

Class

SearchApiElasticsearchAbstractService
Elasticsearch service abstract class.

Code

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