public static function Utility::decodeSolrName in Search API Solr 8
Same name and namespace in other branches
- 8.3 src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::decodeSolrName()
- 8.2 src/Utility/Utility.php \Drupal\search_api_solr\Utility\Utility::decodeSolrName()
- 4.x 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
encodeSolrDynamicFieldName() for details.
1 call to Utility::decodeSolrName()
- UtilitiesTest::testFieldNameEncoder in tests/
src/ Kernel/ UtilitiesTest.php - Tests encoding and decoding of Solr field names.
File
- src/
Utility/ Utility.php, line 254
Class
- Utility
- Utility functions specific to solr.
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);
}