Skip to content

Commit 5b15eb3

Browse files
committed
Incorporate feedback from maryamsulemani97's review
1 parent 0af7a00 commit 5b15eb3

File tree

2 files changed

+52
-49
lines changed

2 files changed

+52
-49
lines changed

.code-samples.meilisearch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ getting_started_add_documents_md: |-
526526
```
527527
getting_started_check_task_status: |-
528528
curl \
529-
-X GET 'http://localhost:7700/indexes/movies/tasks/0'
529+
-X GET 'http://localhost:7700/tasks/0'
530530
getting_started_search_md: |-
531531
```bash
532532
curl \

reference/api/tasks.md

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,62 @@ The task `uid` is incremented **globally.**
1010

1111
<RouteHighlighter method="GET" route="/tasks"/>
1212

13-
List all tasks globally, regardless of index. The `task` objects are contained in the `results` array. Tasks are always returned in descending order of `uid`.
13+
List all tasks globally, regardless of index. The `task` objects are contained in the `results` array.
1414

15-
Task results are paginated and can be filtered.
15+
Tasks are always returned in descending order of `uid`. This means that by default, **the most recently created `task` objects appear first**.
16+
17+
Task results are [paginated](#paginating-tasks) and can be [filtered](#filtering-tasks).
1618

1719
#### Query parameters
1820

19-
| Query Parameter | Description | Default Value |
20-
|-----------------|--------------------------------------|:----------------------------------:|
21-
| **limit** | number of tasks to return | 20 |
22-
| **from** | `uid` of the first task returned | `uid` of the last created task |
21+
| Query Parameter | Description | Default Value |
22+
|-----------------|----------------------------------------------------------------------|:------------------------------:|
23+
| **limit** | number of tasks to return | 20 |
24+
| **from** | `uid` of the first task returned | `uid` of the last created task |
25+
| **status** | [filter tasks](#filtering-tasks) by their `status` | all statuses |
26+
| **type** | [filter tasks](#filtering-tasks) by their `type` | all types |
27+
| **indexUid** | [filter tasks](#filtering-tasks) by their `indexUid`. Case-sensitive | all indexes |
28+
29+
### Example
30+
31+
<CodeSamples id="get_all_tasks_1" />
32+
33+
#### Response: `200 Ok`
34+
35+
```json
36+
{
37+
"results": [
38+
{
39+
"uid": 1,
40+
"indexUid": "movies_reviews",
41+
"status": "enqueued",
42+
"type": "documentAdditionOrUpdate",
43+
"duration": null,
44+
"enqueuedAt": "2021-08-12T10:00:00.000000Z",
45+
"startedAt": null,
46+
"finishedAt": null
47+
},
48+
{
49+
"uid": 0,
50+
"indexUid": "movies",
51+
"status": "succeeded",
52+
"type": "documentAdditionOrUpdate",
53+
"details": {
54+
"receivedDocuments": 100,
55+
"indexedDocuments": 100
56+
},
57+
"duration": "PT16S",
58+
"enqueuedAt": "2021-08-11T09:25:53.000000Z",
59+
"startedAt": "2021-08-11T10:03:00.000000Z",
60+
"finishedAt": "2021-08-11T10:03:16.000000Z"
61+
}
62+
]
63+
}
64+
```
2365

2466
### Filtering tasks
2567

26-
You can filter the task list by the value of the `status`, `type`, or `indexUid` fields. For example, the following command returns all tasks belonging to the index `movies`:
68+
You can filter the task list by the value of the `status`, `type`, or `indexUid` fields. For example, the following command returns all tasks belonging to the index `movies`. Note that the `indexUid` is case-sensitive:
2769

2870
<CodeSamples id="get_all_tasks_by_index_1" />
2971

@@ -35,6 +77,8 @@ For example, the following command would return all `documentAdditionOrUpdate` t
3577
curl -X GET 'http://localhost:7700/tasks?status=succeeded,failed&type=documentAdditionOrUpdate'
3678
```
3779

80+
At this time, `OR` operations between different filters are not supported. For example, you cannot view only tasks which have a type of `documentAddition` **or** a status of `failed`.
81+
3882
[Read more about the possible values of these fields in our asynchronous operations guide.](/learn/advanced/asynchronous_operations.md)
3983

4084
### Paginating tasks
@@ -95,47 +139,6 @@ curl -X GET 'http://localhost:7700/tasks?limit=2&from=8
95139

96140
When the returned value of `next` is `null`, you have reached the final page of results.
97141

98-
### Example
99-
100-
<CodeSamples id="get_all_tasks_1" />
101-
102-
#### Response: `200 Ok`
103-
104-
```json
105-
{
106-
"results": [
107-
{
108-
"uid": 1,
109-
"indexUid": "movies_reviews",
110-
"status": "enqueued",
111-
"type": "documentAdditionOrUpdate",
112-
"duration": null,
113-
"enqueuedAt": "2021-08-12T10:00:00.000000Z",
114-
"startedAt": null,
115-
"finishedAt": null
116-
},
117-
{
118-
"uid": 0,
119-
"indexUid": "movies",
120-
"status": "succeeded",
121-
"type": "documentAdditionOrUpdate",
122-
"details": {
123-
"receivedDocuments": 100,
124-
"indexedDocuments": 100
125-
},
126-
"duration": "PT16S",
127-
"enqueuedAt": "2021-08-11T09:25:53.000000Z",
128-
"startedAt": "2021-08-11T10:03:00.000000Z",
129-
"finishedAt": "2021-08-11T10:03:16.000000Z"
130-
}
131-
]
132-
}
133-
```
134-
135-
:::note
136-
Tasks are displayed in descending order by `uid`. This means that **the most recently created `task` objects appear first**.
137-
:::
138-
139142
## Get one task
140143

141144
<RouteHighlighter method="GET" route="/tasks/{task_uid}"/>

0 commit comments

Comments
 (0)