public function Spellcheck::getAutocompleteSuggestions in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 src/Plugin/search_api_autocomplete/suggester/Spellcheck.php \Drupal\search_api_solr\Plugin\search_api_autocomplete\suggester\Spellcheck::getAutocompleteSuggestions()
- 8.2 src/Plugin/search_api_autocomplete/suggester/Spellcheck.php \Drupal\search_api_solr\Plugin\search_api_autocomplete\suggester\Spellcheck::getAutocompleteSuggestions()
Throws
\Drupal\search_api\SearchApiException
\Drupal\search_api_autocomplete\SearchApiAutocompleteException
File
- src/
Plugin/ search_api_autocomplete/ suggester/ Spellcheck.php, line 61
Class
- Spellcheck
- Provides a suggester plugin that retrieves suggestions from the server.
Namespace
Drupal\search_api_solr\Plugin\search_api_autocomplete\suggesterCode
public function getAutocompleteSuggestions(QueryInterface $query, $incomplete_key, $user_input) {
if (!($backend = static::getBackend($this
->getSearch()
->getIndex()))) {
return [];
}
return $backend
->getSpellcheckSuggestions($query, $this
->getSearch(), $incomplete_key, $user_input);
}