You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: reference/api/tasks.md
+51-48Lines changed: 51 additions & 48 deletions
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,62 @@ The task `uid` is incremented **globally.**
10
10
11
11
<RouteHighlightermethod="GET"route="/tasks"/>
12
12
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.
14
14
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).
|**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
+
<CodeSamplesid="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
+
```
23
65
24
66
### Filtering tasks
25
67
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:
27
69
28
70
<CodeSamplesid="get_all_tasks_by_index_1" />
29
71
@@ -35,6 +77,8 @@ For example, the following command would return all `documentAdditionOrUpdate` t
35
77
curl -X GET 'http://localhost:7700/tasks?status=succeeded,failed&type=documentAdditionOrUpdate'
36
78
```
37
79
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
+
38
82
[Read more about the possible values of these fields in our asynchronous operations guide.](/learn/advanced/asynchronous_operations.md)
39
83
40
84
### Paginating tasks
@@ -95,47 +139,6 @@ curl -X GET 'http://localhost:7700/tasks?limit=2&from=8
95
139
96
140
When the returned value of `next` is `null`, you have reached the final page of results.
97
141
98
-
### Example
99
-
100
-
<CodeSamplesid="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**.
0 commit comments