Skip to content

Commit 364fedf

Browse files
update /indexes with new pagination parameters/response
1 parent 481e44c commit 364fedf

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

.code-samples.meilisearch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ get_one_index_1: |-
88
-X GET 'http://localhost:7700/indexes/movies'
99
list_all_indexes_1: |-
1010
curl \
11-
-X GET 'http://localhost:7700/indexes'
11+
-X GET 'http://localhost:7700/indexes?limit=3'
1212
create_an_index_1: |-
1313
curl \
1414
-X POST 'http://localhost:7700/indexes' \

reference/api/indexes.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ The `/indexes` route allows you to create, manage, and delete your indexes.
88

99
<RouteHighlighter method="GET" route="/indexes"/>
1010

11-
List all [indexes](/learn/core_concepts/indexes.md).
11+
List all [indexes](/learn/core_concepts/indexes.md). Results can be paginated by using the `offset` and `limit` query parameters.
12+
13+
#### Query parameters
14+
15+
| Query parameter | Description | Default value |
16+
| ------------------------ | --------------------------- | :-----------: |
17+
| **offset** | Number of indexes to skip | 0 |
18+
| **limit** | Number of indexes to return | 20 |
1219

1320
### Example
1421

@@ -17,26 +24,31 @@ List all [indexes](/learn/core_concepts/indexes.md).
1724
#### Response: `200 Ok`
1825

1926
```json
20-
[
21-
{
22-
"uid": "books",
23-
"createdAt": "2022-03-08T10:00:27.377346Z",
24-
"updatedAt": "2022-03-08T10:00:27.391209Z",
25-
"primaryKey": "id"
26-
},
27-
{
28-
"uid": "meteorites",
29-
"createdAt": "2022-03-08T10:00:44.518768Z",
30-
"updatedAt": "2022-03-08T10:00:44.582083Z",
31-
"primaryKey": "id"
32-
},
33-
{
34-
"uid": "movies",
35-
"createdAt": "2022-02-10T07:45:15.628261Z",
36-
"updatedAt": "2022-02-21T15:28:43.496574Z",
37-
"primaryKey": "id"
38-
}
39-
]
27+
{
28+
"results": [
29+
{
30+
"uid": "books",
31+
"createdAt": "2022-03-08T10:00:27.377346Z",
32+
"updatedAt": "2022-03-08T10:00:27.391209Z",
33+
"primaryKey": "id"
34+
},
35+
{
36+
"uid": "meteorites",
37+
"createdAt": "2022-03-08T10:00:44.518768Z",
38+
"updatedAt": "2022-03-08T10:00:44.582083Z",
39+
"primaryKey": "id"
40+
},
41+
{
42+
"uid": "movies",
43+
"createdAt": "2022-02-10T07:45:15.628261Z",
44+
"updatedAt": "2022-02-21T15:28:43.496574Z",
45+
"primaryKey": "id"
46+
}
47+
],
48+
"offset": 0,
49+
"limit": 3,
50+
"total": 5
51+
}
4052
```
4153

4254
## Get one index

0 commit comments

Comments
 (0)