class StreamingExpressionQueryHelper in Search API Solr 8.3
Same name and namespace in other branches
- 8.2 src/Utility/StreamingExpressionQueryHelper.php \Drupal\search_api_solr\Utility\StreamingExpressionQueryHelper
- 4.x src/Utility/StreamingExpressionQueryHelper.php \Drupal\search_api_solr\Utility\StreamingExpressionQueryHelper
Provides methods for creating streaming expressions.
Hierarchy
- class \Drupal\search_api\Utility\QueryHelper implements QueryHelperInterface
- class \Drupal\search_api_solr\Utility\StreamingExpressionQueryHelper
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 |
---|---|---|---|---|
QueryHelper:: |
protected | property | The module handler. | |
QueryHelper:: |
protected | property | NULL value to use as a key for the results storage. | |
QueryHelper:: |
protected | property | The parse mode manager. | |
QueryHelper:: |
protected | property | The request stack. | |
QueryHelper:: |
protected | property | Storage for the results, keyed by request and search ID. | |
QueryHelper:: |
public | function |
Adds a result set to the cache. Overrides QueryHelperInterface:: |
|
QueryHelper:: |
public | function |
Creates a new search query object. Overrides QueryHelperInterface:: |
|
QueryHelper:: |
public | function |
Retrieves all results data cached in this request. Overrides QueryHelperInterface:: |
|
QueryHelper:: |
protected | function | Retrieves the current request. | |
QueryHelper:: |
public | function |
Retrieves the results data for a search ID. Overrides QueryHelperInterface:: |
|
QueryHelper:: |
public | function |
Removes the result set with the given search ID from the cache. Overrides QueryHelperInterface:: |
|
QueryHelper:: |
public | function | Constructs a QueryHelper object. | |
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. |