public function SearchApiSolrBackend::alterSuggesterAutocompleteQuery in Search API Solr 8.2
Allow custom changes to the Solarium Suggester autocomplete query.
This is an object oriented equivalent to hook_search_api_solr_suggester_autocomplete_query_alter() to avoid that any logic needs to be split between the backend class and a module file.
Parameters
\Drupal\search_api_solr\Solarium\Autocomplete\Query $solarium_query: The Solarium query object, as generated from the Search API query.
\Drupal\search_api\Query\QueryInterface $query: The Search API query object representing the executed search query.
Overrides SolrAutocompleteInterface::alterSuggesterAutocompleteQuery
See also
1 call to SearchApiSolrBackend::alterSuggesterAutocompleteQuery()
- SearchApiSolrBackend::getSuggesterSuggestions in src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php - Autocompletion suggestions for some user input using Suggester component.
File
- src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php, line 2601
Class
- SearchApiSolrBackend
- Apache Solr backend for search api.
Namespace
Drupal\search_api_solr\Plugin\search_api\backendCode
public function alterSuggesterAutocompleteQuery(AutocompleteQuery $solarium_query, QueryInterface $query) {
// Allow modules to alter the solarium autocomplete query.
$this->moduleHandler
->alter('search_api_solr_suggester_autocomplete_query', $solarium_query, $query);
}