public function StreamingExpressionBuilder::_intersect in Search API Solr 8.3
Same name and namespace in other branches
- 8.2 src/Utility/StreamingExpressionBuilder.php \Drupal\search_api_solr\Utility\StreamingExpressionBuilder::_intersect()
- 4.x src/Utility/StreamingExpressionBuilder.php \Drupal\search_api_solr\Utility\StreamingExpressionBuilder::_intersect()
Eases intersect() streaming expressions by applying required sorts.
Parameters
string $stream1: A streaming expression as string.
string $stream2: A streaming expression as string.
string $field: The Search API field name or Solr reserved field name to use for the intersection.
string $language_id: (optional) The language ID. Defaults to "und".
Return value
string A chainable streaming expression as string.
File
- src/
Utility/ StreamingExpressionBuilder.php, line 495
Class
- StreamingExpressionBuilder
- Provides methods for creating streaming expressions targeting a given index.
Namespace
Drupal\search_api_solr\UtilityCode
public function _intersect(string $stream1, string $stream2, string $field, string $language_id = LanguageInterface::LANGCODE_NOT_SPECIFIED) {
$solr_field = $this
->_field($field, $language_id);
return $this
->intersect($this
->sort($stream1, 'by="' . $solr_field . ' ASC"'), $this
->sort($stream2, 'by="' . $solr_field . ' ASC"'), 'on=' . $solr_field);
}