Skip to content

Commit f0a47f3

Browse files
committed
Change code blocks to code samples
Also rename get_all_tasks_by_index_1
1 parent e6fb851 commit f0a47f3

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

.code-samples.meilisearch.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,18 @@ get_all_tasks_1: |-
8585
get_task_1: |-
8686
curl \
8787
-X GET 'http://localhost:7700/tasks/1'
88-
get_all_tasks_by_index_1: |-
88+
get_all_tasks_filtering_1: |-
8989
curl \
9090
-X GET 'http://localhost:7700/tasks?indexUid=movies'
91+
get_all_tasks_filtering_2: |-
92+
curl \
93+
-X GET 'http://localhost:7700/tasks?status=succeeded,failed&type=documentAdditionOrUpdate'
94+
get_all_tasks_paginating_1: |-
95+
curl \
96+
-X GET 'http://localhost:7700/tasks?limit=2&from=10
97+
get_all_tasks_paginating_2: |-
98+
curl \
99+
-X GET 'http://localhost:7700/tasks?limit=2&from=8
91100
get_one_key_1: |-
92101
curl \
93102
-X GET 'http://localhost:7700/keys/d0552b41536279a0ad88bd595327b96f01176a60c2243e906c52ac02375f9bc4' \

.vuepress/public/sample-template.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ delete_documents_1: |-
1818
search_post_1: |-
1919
get_all_tasks_1: |-
2020
get_task_1: |-
21-
get_all_tasks_by_index_1: |-
21+
get_all_tasks_filtering_1: |-
22+
get_all_tasks_filtering_2: |-
23+
get_all_tasks_paginating_1: |-
24+
get_all_tasks_paginating_2: |-
2225
get_one_key_1: |-
2326
get_all_keys_1: |-
2427
create_a_key_1: |-

reference/api/tasks.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,13 @@ Task results are [paginated](#paginating-tasks) and can be [filtered](#filtering
6767

6868
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:
6969

70-
<CodeSamples id="get_all_tasks_by_index_1" />
70+
<CodeSamples id="get_all_tasks_filtering_1" />
7171

7272
Use the ampersand character `&` to combine filters, equivalent to a logical `AND`. Use the comma character `,` to add multiple filter values for a single field.
7373

7474
For example, the following command would return all `documentAdditionOrUpdate` tasks that either `succeeded` or `failed`:
7575

76-
```bash
77-
curl -X GET 'http://localhost:7700/tasks?status=succeeded,failed&type=documentAdditionOrUpdate'
78-
```
76+
<CodeSamples id="get_all_tasks_filtering_2" />
7977

8078
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`.
8179

@@ -89,9 +87,7 @@ For each call to this endpoint, the response will include the `next` field: this
8987

9088
This command returns tasks two at a time starting from task `uid` `10`.
9189

92-
```bash
93-
curl -X GET 'http://localhost:7700/tasks?limit=2&from=10
94-
```
90+
<CodeSamples id="get_all_tasks_paginating_1" />
9591

9692
**Response:**
9793

@@ -133,9 +129,7 @@ curl -X GET 'http://localhost:7700/tasks?limit=2&from=10
133129

134130
To view the next page of results, you would repeat the same query, replacing the value of `from` with the value of `next`:
135131

136-
```bash
137-
curl -X GET 'http://localhost:7700/tasks?limit=2&from=8
138-
```
132+
<CodeSamples id="get_all_tasks_paginating_2" />
139133

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

0 commit comments

Comments
 (0)