Skip to content

Commit 7a6e010

Browse files
first draft ready
1 parent d43920f commit 7a6e010

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

reference/api/batches.mdx

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Tasks — Meilisearch API reference
3-
description: The /tasks route allows you to manage and monitor Meilisearch's asynchronous operations.
2+
title: Batches — Meilisearch API reference
3+
description: The /batches route allows you to monitor how Meilisearch is grouping and processing asynchronous operations.
44
---
55

66
# Batches
@@ -32,7 +32,7 @@ The `/batches` route gives information about the progress of batches of [asynchr
3232
"startedAt": "2024-12-10T15:20:30.18182Z",
3333
"finishedAt": "2024-12-10T15:20:30.432338Z",
3434
"progress": {
35-
"steps": [
35+
"currentStep": [
3636
{
3737
"name": "extracting words",
3838
"finished": 2,
@@ -62,21 +62,21 @@ The `/batches` route gives information about the progress of batches of [asynchr
6262
### `progress`
6363

6464
**Type**: Object<br />
65-
**Description**: Object containing two fields: `steps` and `percentage`. Once Meilisearch has fully processed a batch, its `progress` is set to `null`.
65+
**Description**: Object containing two fields: `currentStep` and `percentage`. Once Meilisearch has fully processed a batch, its `progress` is set to `null`.
6666

6767
#### `currentStep`
6868

69-
Information about the current operations Meilisearch is performing in this batch. Every step consists of multiple operations. A step may also generate substeps.
69+
Information about the current operations Meilisearch is performing in this batch. A step may consist of multiple substeps.
7070

71-
| Name | Description |
72-
| :---------------------- | :-------------------------------------------------------------------------------------- |
73-
| **`name`** | The internal description of the operation |
74-
| **`total`** | The total number of operations in the step |
71+
| Name | Description |
72+
| :---------------| :------------------------------------------------- |
73+
| **`name`** | A string describing the operation |
74+
| **`total`** | The total number of operations in the step |
7575
| **`finished`** | The number of operations Meilisearch has completed |
7676

7777
#### `percentage`
7878

79-
The progress of the current set of operations, calculated from all operations across all current steps.
79+
The progress of the current set of operations, calculated from all current steps and substeps.
8080

8181
### `stats`
8282

@@ -89,13 +89,7 @@ Number of tasks in the batch.
8989

9090
#### `status`
9191

92-
Object listing the status of each task in the batch. Contains five keys whose values correspond to the number of tasks with that status:
93-
94-
- `succeeded`
95-
- `failed`
96-
- `canceled`
97-
- `processing`
98-
- `enqueued`
92+
Object listing the [status of each task](/reference/api/tasks#status) in the batch. Contains five keys whose values correspond to the number of tasks with that status.
9993

10094
#### `types`
10195

@@ -131,9 +125,9 @@ Batches are always returned in descending order of `uid`. This means that by def
131125
Batch results are [paginated](/learn/async/paginating_tasks) and can be [filtered](/learn/async/filtering_tasks) with query parameters.
132126

133127
<Capsule intent="danger" title="`/batches` parameters and tasks">
134-
Some query parameters for `/batches`, such as `uids` and `statuses`, filter results based on the tasks, not the batches themselves.
128+
Some query parameters for `/batches`, such as `uids` and `statuses`, target tasks instead of batches.
135129

136-
For example, `?uids=0` returns batches containing the task with a `taskUid` equal to `0`, instead of a batch with a `batchUid` equal to `0`.
130+
For example, `?uids=0` returns a batch containing the task with a `taskUid` equal to `0`, instead of a batch with a `batchUid` equal to `0`.
137131
</Capsule>
138132

139133
### Query parameters
@@ -142,18 +136,18 @@ For example, `?uids=0` returns batches containing the task with a `taskUid` equa
142136
| ---------------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
143137
| **`uids`** | `*` (all task uids) | Select batches containing the tasks with the specified `uid`s. Separate multiple task `uids` with a comma (`,`) |
144138
| **`batchUids`** | `*` (all batch uids) | Filter batches by their `uid`. Separate multiple batch `uids` with a comma (`,`) |
145-
| **`limit`** | `20` | Number of batches to return |
146-
| **`from`** | `uid` of the last created batch | `uid` of the first batch returned |
139+
| **`indexUids`** | `*` (all indexes) | Select batches containing tasks affecting the specified indexes. Separate multiple `indexUids` with a comma (`,`) |
147140
| **`statuses`** | `*` (all statuses) | Select batches containing tasks with the specified `status`. Separate multiple task `statuses` with a comma (`,`) |
148141
| **`types`** | `*` (all types) | Select batches containing tasks with the specified `type`. Separate multiple task `types` with a comma (`,`) |
149-
| **`indexUids`** | `*` (all indexes) | Select batches containing tasks affecting the specified indexes. Separate multiple `indexUids` with a comma (`,`) |
142+
| **`limit`** | `20` | Number of batches to return |
143+
| **`from`** | `uid` of the last created batch | `uid` of the first batch returned |
144+
| **`reverse`** | `false` | If `true`, returns results in the reverse order, from oldest to most recent |
150145
| **`beforeEnqueuedAt`** | `*` (all tasks) | Select batches containing tasks with the specified `enqueuedAt` field |
151146
| **`beforeStartedAt`** | `*` (all tasks) | Select batches containing tasks with the specified `startedAt` field |
152147
| **`beforeFinishedAt`** | `*` (all tasks) | Select batches containing tasks with the specified `finishedAt` field |
153148
| **`afterEnqueuedAt`** | `*` (all tasks) | Select batches containing tasks with the specified `enqueuedAt` field |
154149
| **`afterStartedAt`** | `*` (all tasks) | Select batches containing tasks with the specified `startedAt` field |
155150
| **`afterFinishedAt`** | `*` (all tasks) | Select batches containing tasks with the specified `finishedAt` field |
156-
| **`reverse`** | `false` | If `true`, returns results in the reverse order, from oldest to most recent |
157151

158152
### Response
159153

0 commit comments

Comments
 (0)