You are here

public function StreamingExpressionBuilder::_select_renamed_field 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::_select_renamed_field()
  2. 4.x src/Utility/StreamingExpressionBuilder.php \Drupal\search_api_solr\Utility\StreamingExpressionBuilder::_select_renamed_field()

Rename a field within select().

Parameters

string $search_api_field_name_source: The Search API field name to rename.

string $search_api_field_name_target: The target field name.

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

Return value

string The expression as string.

File

src/Utility/StreamingExpressionBuilder.php, line 445

Class

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

Namespace

Drupal\search_api_solr\Utility

Code

public function _select_renamed_field(string $search_api_field_name_source, string $search_api_field_name_target, string $language_id = LanguageInterface::LANGCODE_NOT_SPECIFIED) {
  return $this
    ->_field($search_api_field_name_source, $language_id) . ' as ' . $this
    ->_field($search_api_field_name_target, $language_id);
}