Skip to main content
The length parameter can be used with offset as an alternative approach to pagination.

Usage

  • If offset is omitted, length is ignored.
  • If offset is specified but length omitted, the number of records returned is equal to hitsPerPage.
With offset and length, the response includes these fields:
{
  // ...
  "offset": 5,
  "length": 10,
  // ...
}

Example

Current API clients

var response = await client.SearchSingleIndexAsync<Hit>(
  "ALGOLIA_INDEX_NAME",
  new SearchParams(new SearchParamsObject { Query = "query", Length = 4 })
);
index.Search(new Query("query")
{
    Length = 4
    Offset = 1
});
I