function hook_search_api_solr_terms_autocomplete_query_alter in Search API Solr 8.2
Same name and namespace in other branches
- 8.3 search_api_solr.api.php \hook_search_api_solr_terms_autocomplete_query_alter()
- 4.x search_api_solr.api.php \hook_search_api_solr_terms_autocomplete_query_alter()
Lets modules alter the terms autocomplete query before executing it.
Parameters
\Drupal\search_api\Query\QueryInterface $query: The Search API query object representing the executed search query.
1 invocation of hook_search_api_solr_terms_autocomplete_query_alter()
- SearchApiSolrBackend::alterTermsAutocompleteQuery in src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php - Allow custom changes to the Solarium Terms autocomplete query.
File
- ./
search_api_solr.api.php, line 75 - Hooks provided by the Search API Solr search module.
Code
function hook_search_api_solr_terms_autocomplete_query_alter(\Drupal\search_api\Query\QueryInterface $query) {
// If the Search API query has a 'terms' component, set a custom option.
$query
->setOption('solr_param_code', 'custom-value');
}