You are here

public function StreamingExpressionBuilder::_field_escaped_value in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Utility/StreamingExpressionBuilder.php \Drupal\search_api_solr\Utility\StreamingExpressionBuilder::_field_escaped_value()
  2. 4.x src/Utility/StreamingExpressionBuilder.php \Drupal\search_api_solr\Utility\StreamingExpressionBuilder::_field_escaped_value()

Formats a field and its escaped value to be used in a Solr streaming expression.

Parameters

string $search_api_field_name:

string $value:

bool $single_term: Escapes the value as single term if TRUE, otherwise as phrase.

Return value

string The Solr field name and the escaped value as 'field:value'.

File

src/Utility/StreamingExpressionBuilder.php, line 273

Class

StreamingExpressionBuilder
Provides methods for creating streaming expressions targeting a given index.

Namespace

Drupal\search_api_solr\Utility

Code

public function _field_escaped_value(string $search_api_field_name, string $value, bool $single_term = TRUE) {
  return $this
    ->_field($search_api_field_name) . ':' . $this
    ->_escaped_value($value, $single_term, $search_api_field_name);
}