You are here

public static function Utility::getSolrDynamicFieldNameForLanguageSpecificSolrDynamicFieldName in Search API Multilingual Solr Search 8

Maps a language-specific Solr field name to its unspecific equivalent.

For example the dynamic field tm;en_* for English will become tm_*.

Parameters

string $field_name: The field name.

string $language_id: The Drupal langauge code.

Return value

string The language-specific name.

See also

Drupal\search_api_solr_multilingual\Utility\Utility::getLanguageSpecificSolrDynamicFieldNameForSolrDynamicFieldName()

Drupal\search_api_solr\Utility\Utility::encodeSolrName()

https://wiki.apache.org/solr/SchemaXml#Dynamic_fields

2 calls to Utility::getSolrDynamicFieldNameForLanguageSpecificSolrDynamicFieldName()
AbstractSearchApiSolrMultilingualBackend::alterSolrResponseBody in src/Plugin/search_api/backend/AbstractSearchApiSolrMultilingualBackend.php
@inheritdoc
UtilitiesTest::doDynamicFieldNameConversions in tests/src/Kernel/UtilitiesTest.php
Tests all conversion and extraction functions.

File

src/Utility/Utility.php, line 73

Class

Utility
Provides various helper functions for multilingual Solr backends.

Namespace

Drupal\search_api_solr_multilingual\Utility

Code

public static function getSolrDynamicFieldNameForLanguageSpecificSolrDynamicFieldName($field_name) {
  return Utility::modifySolrDynamicFieldName($field_name, '@^([a-z]+)' . SEARCH_API_SOLR_MULTILINGUAL_LANGUAGE_SEPARATOR . '[^_]+?_@', '$1_');
}