You are here

public function SearchApiQuery::createFilter in Search API 7

Creates a new filter to use with this query object.

Parameters

string $conjunction: The conjunction to use for the filter - either 'AND' or 'OR'.

$tags: (Optional) An arbitrary set of tags. Can be used to identify this filter down the line if necessary. This is primarily used by the facet system to support OR facet queries.

Return value

SearchApiQueryFilterInterface A filter object that is set to use the specified conjunction.

Overrides SearchApiQueryInterface::createFilter

2 calls to SearchApiQuery::createFilter()
SearchApiQuery::addLanguages in includes/query.inc
Adds language filters for the query.
SearchApiQuery::__construct in includes/query.inc
Constructs a new search query.

File

includes/query.inc, line 548
Contains SearchApiQueryInterface and SearchApiQuery.

Class

SearchApiQuery
Provides a standard implementation of the SearchApiQueryInterface.

Code

public function createFilter($conjunction = 'AND', $tags = array()) {
  $filter_class = $this->options['filter class'];
  return new $filter_class($conjunction, $tags);
}