You are here

function hook_search_api_results_alter in Search API 8

Same name and namespace in other branches
  1. 7 search_api.api.php \hook_search_api_results_alter()

Alter a search query's result set.

The hook is invoked after all enabled processors have postprocessed the results.

Parameters

\Drupal\search_api\Query\ResultSetInterface $results: The search results to alter.

Deprecated

in search_api:8.x-1.14 and is removed from search_api:2.0.0. Please use the "search_api.processing_results" event instead.

See also

https://www.drupal.org/node/3059866

2 functions implement hook_search_api_results_alter()

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

search_api_test_excerpt_field_search_api_results_alter in tests/search_api_test_excerpt_field/search_api_test_excerpt_field.module
Implements hook_search_api_results_alter().
search_api_test_hooks_search_api_results_alter in tests/search_api_test_hooks/search_api_test_hooks.search_api.inc
Implements hook_search_api_results_alter().

File

./search_api.api.php, line 390
Hooks provided by the Search API module.

Code

function hook_search_api_results_alter(\Drupal\search_api\Query\ResultSetInterface &$results) {
  $results
    ->setExtraData('example_hook_invoked', microtime(TRUE));
}