public function Server::getSupportedFeatures in Search API 8
Returns all features that this backend supports.
Features are optional extensions to Search API functionality and usually defined and used by third-party modules.
There are currently two features defined directly in the Search API module:
- search_api_mlt, by the \Drupal\search_api\Plugin\views\argument\SearchApiMoreLikeThis class.
- search_api_random_sort, by the \Drupal\search_api\Plugin\views\query\SearchApiQuery class.
Return value
string[] The identifiers of all features this backend supports.
Overrides BackendSpecificInterface::getSupportedFeatures
See also
hook_search_api_server_features_alter()
1 call to Server::getSupportedFeatures()
- Server::supportsFeature in src/
Entity/ Server.php - Determines whether this server supports a given feature.
File
- src/
Entity/ Server.php, line 211
Class
- Server
- Defines the search server configuration entity.
Namespace
Drupal\search_api\EntityCode
public function getSupportedFeatures() {
if (!isset($this->features)) {
$this->features = [];
if ($this
->hasValidBackend()) {
$this->features = $this
->getBackend()
->getSupportedFeatures();
}
$description = 'This hook is 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 https://www.drupal.org/node/3059866';
\Drupal::moduleHandler()
->alterDeprecated($description, 'search_api_server_features', $this->features, $this);
/** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher */
$eventDispatcher = \Drupal::getContainer()
->get('event_dispatcher');
$eventDispatcher
->dispatch(SearchApiEvents::DETERMINING_SERVER_FEATURES, new DeterminingServerFeaturesEvent($this->features, $this));
}
return $this->features;
}