You are here

public function SearchApiIndex::query in Search API 7

Create a query object for this index.

Parameters

$options: Associative array of options configuring this query. See SearchApiQueryInterface::__construct().

Return value

SearchApiQueryInterface A query object for searching this index.

Throws

SearchApiException If the index is currently disabled or its server doesn't exist.

File

includes/index_entity.inc, line 435
Contains SearchApiIndex.

Class

SearchApiIndex
Class representing a search index.

Code

public function query($options = array()) {
  if (!$this->enabled) {
    throw new SearchApiException(t('Cannot search on a disabled index.'));
  }
  return $this
    ->server()
    ->query($this, $options);
}