You are here

public function StreamingExpressionBuilder::_field_escaped_value in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 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 for a Solr streaming expression.

Parameters

string $search_api_field_name: The Search API field name.

string $value: The field value.

bool $single_term: (optional) Escapes the value as single term if TRUE, otherwise as phrase. Defaults to TRUE.

string $language_id: (optional) The language ID. Defaults to "und".

Return value

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

File

src/Utility/StreamingExpressionBuilder.php, line 401

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, string $language_id = LanguageInterface::LANGCODE_NOT_SPECIFIED) {
  return $this
    ->_field($search_api_field_name, $language_id) . ':' . $this
    ->_escaped_value($value, $single_term, $search_api_field_name);
}