In most cases,
page
/
hitsPerPage
is
the recommended method for
pagination
.
This setting is part of an
alternative paging approach
.
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):
index
.
search
(
query
:
query
)
{
result
in
if
case
.
success
(
let
response
)
=
result
{
print
(
"Response:
\(
response
)
"
)
We appreciate your feedback! Please note that we can't respond.
If you have questions, please reach out to
the support team
.