You are here

function hook_search_api_autocomplete_suggester_info_alter in Search API Autocomplete 7

Same name and namespace in other branches
  1. 8 search_api_autocomplete.api.php \hook_search_api_autocomplete_suggester_info_alter()

Alter the plugins available for calculating autocomplete suggestions.

Parameters

array $suggesters: An array of suggester plugin definitions, keyed by plugin ID (should be unique, and thus be prefixed with your module's name). Each definition is an associative array with the following keys (and possibly others):

  • label: The human-readable, translated label of the plugin.
  • description: (optional) A translated text describing the plugin in a bit more detail.
  • class: The plugin class. Must implement SearchApiAutocompleteSuggesterInterface.

See also

hook_search_api_autocomplete_suggester_info()

1 invocation of hook_search_api_autocomplete_suggester_info_alter()
search_api_autocomplete_suggester_info in ./search_api_autocomplete.module
Retrieves the definitions of all suggester plugins, or a specific one.

File

./search_api_autocomplete.api.php, line 103
Hooks provided by the Search API autocomplete module.

Code

function hook_search_api_autocomplete_suggester_info_alter(array &$suggesters) {
  if (isset($suggesters['foobar'])) {
    $suggesters['foobar']['my_custom_override_previous'] = $suggesters['foobar']['class'];
    $suggesters['foobar']['class'] = 'MyCustomOverrideSuggester';
  }
}