setOffset method

AlgoliaQuery setOffset(
  1. int value
)

Offset

Specify the offset of the first hit to return.

Offset is the position in the dataset of a particular record. By specifying offset, you retrieve a subset of records starting with the offset value. Offset normally works with length, which determines how many records to retrieve starting from the offset.

Usage notes:

  • Offset is zero-based: the 10th record is at offset 9.
  • If you omit length, the number of records returned is equal to the hitsPerPage. In fact, using offset requires that you specify length as well; otherwise, it defaults to page-based pagination.
  • If offset is specified, page is ignored.
  • Usage: If you have 100 records in your result set, and you want to retrieve records 50 to 80, you will need to use offset=49 and length = 30.

Impact on the response - Page-based pagination (page / hitsPerPage):

Source: Learn more

Implementation

AlgoliaQuery setOffset(int value) {
  assert(!_parameters.containsKey('offset'));
  return _copyWithParameters(<String, dynamic>{'offset': value});
}