You are here

protected function SearchApiSolrBackend::setAutocompleteSpellCheckQuery in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::setAutocompleteSpellCheckQuery()
  2. 4.x src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::setAutocompleteSpellCheckQuery()

Set the spellcheck parameters for the solarium autocomplete query.

Parameters

\Drupal\search_api\Query\QueryInterface $query: A query representing the completed user input so far.

AutocompleteQuery $solarium_query: An autocomplete solarium query.

string $user_input: The user input.

1 call to SearchApiSolrBackend::setAutocompleteSpellCheckQuery()
SearchApiSolrBackend::getSpellcheckSuggestions in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Autocompletion suggestions for some user input using Spellcheck component.

File

src/Plugin/search_api/backend/SearchApiSolrBackend.php, line 2641

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

protected function setAutocompleteSpellCheckQuery(QueryInterface $query, AutocompleteQuery $solarium_query, $user_input) {
  $spellcheck_component = $solarium_query
    ->getSpellcheck();
  $spellcheck_component
    ->setQuery($user_input);
  $spellcheck_component
    ->setCount($query
    ->getOption('limit', 1));
}