public static function Utility::decodeSolrName in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::decodeSolrName()
- 8 src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::decodeSolrName()
- 8.2 src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::decodeSolrName()
Decodes solr field names.
This function therefore decodes all forbidden characters from their hexadecimal equivalent encapsulated by a leading sequence of '_X' and a termination character '_'. Example: "tm_entity_X3a_node_X2f_body" becomes "tm_entity:node/body".
Parameters
string $field_name: Encoded field name.
Return value
string The decoded field name
See also
\Drupal\search_api_solr\Utility\Utility::modifySolrDynamicFieldName()
7 calls to Utility::decodeSolrName()
- SearchApiSolrBackend::formatSolrFieldNames in src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php - Returns a language-specific mapping from Drupal to Solr field names.
- UtilitiesTest::testFieldNameEncoder in tests/
src/ Kernel/ UtilitiesTest.php - Tests encoding and decoding of Solr field names.
- UtilitiesTest::testLanguageSpecificFieldTypeNames in tests/
src/ Kernel/ UtilitiesTest.php - Tests language-specific Solr field names.
- Utility::buildSuggesterContextFilterQuery in src/
Utility/ Utility.php - Builds the filter query for a Suggester context given an array of tags.
- Utility::extractLanguageSpecificSolrDynamicFieldDefinition in src/
Utility/ Utility.php - Extracts the language-specific definition from a dynamic Solr field.
File
- src/
Utility/ Utility.php, line 313
Class
- Utility
- Provides various helper functions for Solr backends.
Namespace
Drupal\search_api_solr\UtilityCode
public static function decodeSolrName($field_name) {
return preg_replace_callback('/_X([\\dabcdef]+?)_/', function ($matches) {
return hex2bin($matches[1]);
}, $field_name);
}