You are here

function hook_search_api_autocomplete_suggestions_alter in Search API Autocomplete 7

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

Alter autocomplete suggestions.

Parameters

array $suggestions: Associative array where keys are the complete suggested keywords, and the values are suggestion arrays as defined by SearchApiAutocompleteInterface::getAutocompleteSuggestions().

array $context: An associative array containing the parameters for the original SearchApiAutocompleteInterface::getAutocompleteSuggestions() call, in the keys "query", "search", "incomplete_key" and "user_input".

1 invocation of hook_search_api_autocomplete_suggestions_alter()
search_api_autocomplete_autocomplete in ./search_api_autocomplete.pages.inc
Page callback for getting autocomplete suggestions.

File

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

Code

function hook_search_api_autocomplete_suggestions_alter(array &$suggestions, array $context) {

  // Sort suggestions in alphabetical order.
  ksort($suggestions);
}