You are here

public function SearchApiSolrBackend::alterTermsAutocompleteQuery in Search API Solr 8.2

Allow custom changes to the Solarium Terms autocomplete query.

This is an object oriented equivalent to hook_search_api_solr_terms_autocomplete_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 Search API query object representing the executed search query.

Overrides SolrAutocompleteInterface::alterTermsAutocompleteQuery

See also

hook_search_api_query_alter()

1 call to SearchApiSolrBackend::alterTermsAutocompleteQuery()
SearchApiSolrBackend::getTermsSuggestions in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Autocompletion suggestions for some user input using Terms component.

File

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

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

public function alterTermsAutocompleteQuery(QueryInterface $query) {

  // Allow modules to alter the solarium autocomplete query.
  $this->moduleHandler
    ->alter('search_api_solr_terms_autocomplete_query', $query);
}