setLength method

AlgoliaQuery setLength(
  1. int value
)

Length

Set the number of hits to retrieve (used only with offset).

Similar to hitsPerPage, but works only with offset.

Usage notes:

  • 1000 is the maximum.
  • If offset is omitted, length is ignored.
  • On the other hand, if you specify offset but 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.

Source: Learn more

Implementation

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