You are here

public function SearchApiQuery::setSearchApiQuery in Search API 8

Sets the Search API query object.

Usually this is done by the query plugin class itself, but in rare cases (such as for caching purposes) it might be necessary to set it from outside.

Parameters

\Drupal\search_api\Query\QueryInterface $query: The new query.

Return value

$this

File

src/Plugin/views/query/SearchApiQuery.php, line 820

Class

SearchApiQuery
Defines a Views query class for searching on Search API indexes.

Namespace

Drupal\search_api\Plugin\views\query

Code

public function setSearchApiQuery(QueryInterface $query) {
  $this->query = $query;
  return $this;
}