class StreamingExpressionQueryHelper in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 src/Utility/StreamingExpressionQueryHelper.php \Drupal\search_api_solr\Utility\StreamingExpressionQueryHelper
- 8.2 src/Utility/StreamingExpressionQueryHelper.php \Drupal\search_api_solr\Utility\StreamingExpressionQueryHelper
Provides methods for creating streaming expressions.
Hierarchy
- class \Drupal\search_api_solr\Utility\StreamingExpressionQueryHelper extends \Drupal\search_api\Utility\QueryHelper
Expanded class hierarchy of StreamingExpressionQueryHelper
1 string reference to 'StreamingExpressionQueryHelper'
1 service uses StreamingExpressionQueryHelper
File
- src/
Utility/ StreamingExpressionQueryHelper.php, line 11
Namespace
Drupal\search_api_solr\UtilityView source
class StreamingExpressionQueryHelper extends QueryHelper {
/**
* Builds a streaming expression for the given Search API query.
*
* @param \Drupal\search_api\Query\QueryInterface $query
* The Search API query.
*
* @return \Drupal\search_api_solr\Utility\StreamingExpressionBuilder
* The StreamingExpressionBuilder object.
*
* @throws \Drupal\search_api\SearchApiException
* @throws \Drupal\search_api_solr\SearchApiSolrException
*/
public function getStreamingExpressionBuilder(QueryInterface $query) {
return new StreamingExpressionBuilder($query
->getIndex());
}
/**
* Applies a streaming expression for a given Search API query.
*
* @param \Drupal\search_api\Query\QueryInterface $query
* The Search API query.
* @param \Drupal\search_api_solr\Utility\string $streaming_expression
* The streaming expression to set for this query.
* @param \Drupal\search_api_solr\Utility\string $comment
* A comment of the streaming expression.
*/
public function setStreamingExpression(QueryInterface $query, string $streaming_expression, string $comment = '') {
if ($comment) {
$query
->setOption('solr_streaming_expression_comment', $comment);
}
$query
->setOption('solr_streaming_expression', $streaming_expression);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
StreamingExpressionQueryHelper:: |
public | function | Builds a streaming expression for the given Search API query. | |
StreamingExpressionQueryHelper:: |
public | function | Applies a streaming expression for a given Search API query. |