protected function SearchApiSolrBackend::applySearchWorkarounds in Search API Solr 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::applySearchWorkarounds()
- 8 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::applySearchWorkarounds()
- 4.x src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::applySearchWorkarounds()
Apply workarounds for special Solr versions before searching.
Parameters
\Solarium\Core\Query\QueryInterface $solarium_query: The Solarium select query object.
\Drupal\search_api\Query\QueryInterface $query: The \Drupal\search_api\Query\Query object representing the executed search query.
4 calls to SearchApiSolrBackend::applySearchWorkarounds()
- SearchApiSolrAnySchemaBackend::applySearchWorkarounds in src/
Plugin/ search_api/ backend/ SearchApiSolrAnySchemaBackend.php - Apply workarounds for special Solr versions before searching.
- SearchApiSolrBackend::executeGraphStreamingExpression in src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php - Executes a graph streaming expression.
- SearchApiSolrBackend::executeStreamingExpression in src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php - Executes a streaming expression.
- SearchApiSolrBackend::search in src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php - Options on $query prefixed by 'solr_param_' will be passed natively to Solr as query parameter without the prefix. For example you can set the "Minimum Should Match" parameter 'mm' to '75%' like this:
1 method overrides SearchApiSolrBackend::applySearchWorkarounds()
- SearchApiSolrAnySchemaBackend::applySearchWorkarounds in src/
Plugin/ search_api/ backend/ SearchApiSolrAnySchemaBackend.php - Apply workarounds for special Solr versions before searching.
File
- src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php, line 1223
Class
- SearchApiSolrBackend
- Apache Solr backend for search api.
Namespace
Drupal\search_api_solr\Plugin\search_api\backendCode
protected function applySearchWorkarounds(SolariumQueryInterface $solarium_query, QueryInterface $query) {
// Do not modify 'Server index status' queries.
// @see https://www.drupal.org/node/2668852
if ($query
->hasTag('server_index_status')) {
return;
}
/* We keep this as an example.
$connector = $this->getSolrConnector();
$schema_version = $connector->getSchemaVersion();
$solr_version = $connector->getSolrVersion();
// Schema versions before 4.4 set the default query operator to 'AND'. But
// incompatibilities since Solr 5.5.0 required a new query builder that
// bases on 'OR'.
// @see https://www.drupal.org/node/2724117
if (version_compare($schema_version, '4.4', '<')) {
$params = $solarium_query->getParams();
if (!isset($params['q.op'])) {
$solarium_query->addParam('q.op', 'OR');
}
}
*/
}