public static function Utility::getSolrDynamicFieldNameForLanguageSpecificSolrDynamicFieldName in Search API Solr 8.2
Same name and namespace in other branches
- 8.3 src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::getSolrDynamicFieldNameForLanguageSpecificSolrDynamicFieldName()
- 4.x src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::getSolrDynamicFieldNameForLanguageSpecificSolrDynamicFieldName()
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\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 355
Class
- Utility
- Provides various helper functions for Solr backends.
Namespace
Drupal\search_api_solr\UtilityCode
public static function getSolrDynamicFieldNameForLanguageSpecificSolrDynamicFieldName($field_name) {
return Utility::modifySolrDynamicFieldName($field_name, '@^([a-z]+)' . SEARCH_API_SOLR_LANGUAGE_SEPARATOR . '[^_]+?_@', '$1_');
}