function hook_search_api_server_features_alter in Search API 8
Alter the features a given search server supports.
Parameters
string[] $features: The features supported by the server's backend.
\Drupal\search_api\ServerInterface $server: The search server in question.
Deprecated
in search_api:8.x-1.14 and is removed from search_api:2.0.0. Please use the "search_api.determining_server_features" event instead.
See also
https://www.drupal.org/node/3059866
\Drupal\search_api\Backend\BackendSpecificInterface::getSupportedFeatures()
1 function implements hook_search_api_server_features_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_hooks_search_api_server_features_alter in tests/
search_api_test_hooks/ search_api_test_hooks.search_api.inc - Implements hook_search_api_server_features_alter().
File
- ./
search_api.api.php, line 51 - Hooks provided by the Search API module.
Code
function hook_search_api_server_features_alter(array &$features, \Drupal\search_api\ServerInterface $server) {
if ($server
->getBackend() instanceof \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend) {
$features[] = 'my_custom_feature';
}
}