Paginating tasks
By default, Meilisearch returns a list of 20 tasks for each request when you query the get tasks endpoint. This guide shows you how to navigate the task list using query parameters.
Configuring the number of returned tasks
Use the limit
parameter to change the number of returned tasks:
curl \
-X GET 'http://localhost:7700/tasks?limit=2&from=10
Meilisearch will return a batch of tasks. Each batch of returned tasks is often called a "page" of tasks, and the size of that page is determined by limit
:
{
"results": [
…
],
"total": 50,
"limit": 2,
"from": 10,
"next": 8
}
It is possible none of the returned tasks are the ones you are looking for. In that case, you will need to use the get all tasks request response to navigate the results.
Navigating the task list with from
and next
Use the next
value included in the response to your previous query together with from
to fetch the next set of results:
curl \
-X GET 'http://localhost:7700/tasks?limit=2&from=8
This will return a new batch of tasks:
{
"results": [
…
],
"total": 50,
"limit": 2,
"from": 8,
"next": 6
}
When the value of next
is null
, you have reached the final set of results.
TIP
Use from
and limit
together with task filtering parameters to navigate filtered task lists.