You are here

protected function SearchApiSolrBackend::alterSearchApiQuery in Search API Solr 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::alterSearchApiQuery()

Allow custom changes before converting a SearchAPI query into a Solr query.

This is an object oriented equivalent to hook_search_api_query_alter() to avoid that any logic needs to be split between the backend class and a module file.

Parameters

\Drupal\search_api\Query\QueryInterface $query: The \Drupal\search_api\Query\Query object.

See also

hook_search_api_query_alter()

1 call to SearchApiSolrBackend::alterSearchApiQuery()
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:

File

src/Plugin/search_api/backend/SearchApiSolrBackend.php, line 2018

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

protected function alterSearchApiQuery(QueryInterface $query) {
}