You are here

public function Search::createQuery in Search API Autocomplete 8

Creates a query object for this search.

Parameters

string $keys: The fulltext search keywords to place on the query.

array $data: (optional) Additional data passed to the callback.

Return value

\Drupal\search_api\Query\QueryInterface The query that would normally be executed when $keys is entered as the keywords for this search. Callers should check whether keywords are actually set on the query.

Throws

\Drupal\search_api_autocomplete\SearchApiAutocompleteException Thrown if the query couldn't be created.

Overrides SearchInterface::createQuery

File

src/Entity/Search.php, line 397

Class

Search
Describes the autocomplete settings for a certain search.

Namespace

Drupal\search_api_autocomplete\Entity

Code

public function createQuery($keys, array $data = []) {
  return $this
    ->getSearchPlugin()
    ->createQuery($keys, $data);
}