You are here

public static function SearchApiSolrConnection::escapeFieldName in Search API Solr 7

Escapes a Search API field name for passing to Solr.

Since field names can only contain one special character, ":", there is no need to use the complete escape() method.

Parameters

string $value: The field name to escape.

Return value

string An escaped string suitable for passing to Solr.

Overrides SearchApiSolrConnectionInterface::escapeFieldName

File

includes/solr_connection.inc, line 710

Class

SearchApiSolrConnection
Represents a Solr server resource.

Code

public static function escapeFieldName($value) {
  $value = str_replace(':', '\\:', $value);
  return $value;
}