You are here

function hook_search_api_autocomplete_suggester_info in Search API Autocomplete 7

Add new plugins for calculating autocomplete suggestions.

Return value

array 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:

  • 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.

Additional keys will be retained and passed to the plugin as part of its definition upon creation.

See also

SearchApiAutocompleteSuggesterInterface

SearchApiAutocompleteSuggesterPluginBase

hook_search_api_autocomplete_suggester_info_alter()

1 function implements hook_search_api_autocomplete_suggester_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

search_api_autocomplete_search_api_autocomplete_suggester_info in ./search_api_autocomplete.module
Implements hook_search_api_autocomplete_suggester_info().
1 invocation of hook_search_api_autocomplete_suggester_info()
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 77
Hooks provided by the Search API autocomplete module.

Code

function hook_search_api_autocomplete_suggester_info() {

  // Source: search_api_autocomplete_search_api_autocomplete_suggester_info().
  $suggesters['server'] = array(
    'label' => t('Retrieve from server'),
    'description' => t('For compatible servers, ask the server for autocomplete suggestions.'),
    'class' => 'SearchApiAutocompleteServerSuggester',
  );
  return $suggesters;
}