You are here

public static function Spellcheck::supportsSearch in Search API Solr 4.x

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

Throws

\Drupal\search_api\SearchApiException

\Drupal\search_api_autocomplete\SearchApiAutocompleteException

File

src/Plugin/search_api_autocomplete/suggester/Spellcheck.php, line 35

Class

Spellcheck
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(), '4', '>=');
}