Skip to content

Commit 61d0bd9

Browse files
add batchStrategy to batch object
1 parent 8909b97 commit 61d0bd9

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

reference/api/batches.mdx

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ The `/batches` route gives information about the progress of batches of [asynchr
1616
```json
1717
{
1818
"uid": 0,
19+
"progress": {
20+
"steps": [
21+
{
22+
"currentStep": "extracting words",
23+
"finished": 2,
24+
"total": 9,
25+
},
26+
{
27+
"currentStep": "document",
28+
"finished": 30546,
29+
"total": 31944,
30+
}
31+
],
32+
"percentage": 32.8471
33+
},
1934
"details": {
2035
"receivedDocuments": 6,
2136
"indexedDocuments": 6
@@ -38,21 +53,7 @@ The `/batches` route gives information about the progress of batches of [asynchr
3853
"duration": "PT0.250518S",
3954
"startedAt": "2024-12-10T15:20:30.18182Z",
4055
"finishedAt": "2024-12-10T15:20:30.432338Z",
41-
"progress": {
42-
"steps": [
43-
{
44-
"currentStep": "extracting words",
45-
"finished": 2,
46-
"total": 9,
47-
},
48-
{
49-
"currentStep": "document",
50-
"finished": 30546,
51-
"total": 31944,
52-
}
53-
],
54-
"percentage": 32.8471
55-
}
56+
"batchStrategy": "batched all enqueued tasks"
5657
}
5758
```
5859

@@ -137,6 +138,11 @@ Size of each internal database, including by how much it changed after a batch w
137138
**Type**: String<br />
138139
**Description**: The date and time when the tasks finished `processing`, whether `failed`, `succeeded`, or `canceled`, in [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format
139140

141+
### `batchStrategy`
142+
143+
**Type**: String<br />
144+
**Description**: A string describing the logic behind the creation of the batch. Can contain useful information when diagnosing indexing performance issues.
145+
140146
## Get batches
141147

142148
<RouteHighlighter method="GET" path="/batches" />
@@ -193,13 +199,13 @@ For example, `?uids=0` returns a batch containing the task with a `taskUid` equa
193199
"results": [
194200
{
195201
"uid": 2,
202+
"progress": null,
196203
"details": {
197204
"stopWords": [
198205
"of",
199206
"the"
200207
]
201208
},
202-
"progress": null,
203209
"stats": {
204210
"totalNbTasks": 1,
205211
"status": {
@@ -217,7 +223,8 @@ For example, `?uids=0` returns a batch containing the task with a `taskUid` equa
217223
},
218224
"duration": "PT0.110083S",
219225
"startedAt": "2024-12-10T15:49:04.995321Z",
220-
"finishedAt": "2024-12-10T15:49:05.105404Z"
226+
"finishedAt": "2024-12-10T15:49:05.105404Z",
227+
"batchStrategy": "batched all enqueued tasks"
221228
}
222229
],
223230
"total": 3,
@@ -267,6 +274,7 @@ Get a single batch.
267274
},
268275
"duration": "PT0.364788S",
269276
"startedAt": "2024-12-10T15:48:49.672141Z",
270-
"finishedAt": "2024-12-10T15:48:50.036929Z"
277+
"finishedAt": "2024-12-10T15:48:50.036929Z",
278+
"batchStrategy": "batched all enqueued tasks"
271279
}
272280
```

0 commit comments

Comments
 (0)