You are here

public function SearchApiQuery::range in Search API 8

Adds a range of results to return.

This will be saved in the query's options. If called without parameters, this will remove all range restrictions previously set.

Parameters

int|null $offset: The zero-based offset of the first result returned.

int|null $limit: The number of results to return.

Return value

$this

See also

\Drupal\search_api\Query\QueryInterface::range()

File

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

Class

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

Namespace

Drupal\search_api\Plugin\views\query

Code

public function range($offset = NULL, $limit = NULL) {
  if (!$this
    ->shouldAbort()) {
    $this->query
      ->range($offset, $limit);
  }
  return $this;
}