You are here

public static function Suggester::supportsSearch in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/search_api_autocomplete/suggester/Suggester.php \Drupal\search_api_solr\Plugin\search_api_autocomplete\suggester\Suggester::supportsSearch()
  2. 4.x src/Plugin/search_api_autocomplete/suggester/Suggester.php \Drupal\search_api_solr\Plugin\search_api_autocomplete\suggester\Suggester::supportsSearch()

Throws

\Drupal\search_api\SearchApiException

\Drupal\search_api_autocomplete\SearchApiAutocompleteException

Overrides SuggesterPluginBase::supportsSearch

File

src/Plugin/search_api_autocomplete/suggester/Suggester.php, line 37

Class

Suggester
Provides a suggester plugin that retrieves suggestions from the server.

Namespace

Drupal\search_api_solr\Plugin\search_api_autocomplete\suggester

Code

public static function supportsSearch(SearchInterface $search) {

  /** @var \Drupal\search_api_solr\SolrBackendInterface $backend */
  $backend = static::getBackend($search
    ->getIndex());
  return $backend && version_compare($backend
    ->getSolrConnector()
    ->getSolrMajorVersion(), '6', '>=');
}