Skip to content

Commit 747c0a6

Browse files
Merge #1744
1744: v0.28: `/indexes` changes r=maryamsulemani97 a=guimachiavelli Closes #1701 Co-authored-by: gui machiavelli <[email protected]>
2 parents 13459d7 + 364fedf commit 747c0a6

File tree

3 files changed

+34
-27
lines changed

3 files changed

+34
-27
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' \

learn/core_concepts/indexes.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ The `uid` is the **unique identifier** of an index. It is set when creating the
2929
```json
3030
{
3131
"uid": "movies",
32-
"name": "movies",
3332
"createdAt": "2019-11-20T09:40:33.711324Z",
3433
"updatedAt": "2019-11-20T10:16:42.761858Z"
3534
}

reference/api/indexes.md

Lines changed: 33 additions & 25 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,29 +24,31 @@ List all [indexes](/learn/core_concepts/indexes.md).
1724
#### Response: `200 Ok`
1825

1926
```json
20-
[
21-
{
22-
"uid": "books",
23-
"name": "books",
24-
"createdAt": "2022-03-08T10:00:27.377346Z",
25-
"updatedAt": "2022-03-08T10:00:27.391209Z",
26-
"primaryKey": "id"
27-
},
28-
{
29-
"uid": "meteorites",
30-
"name": "meteorites",
31-
"createdAt": "2022-03-08T10:00:44.518768Z",
32-
"updatedAt": "2022-03-08T10:00:44.582083Z",
33-
"primaryKey": "id"
34-
},
35-
{
36-
"uid": "movies",
37-
"name": "movies",
38-
"createdAt": "2022-02-10T07:45:15.628261Z",
39-
"updatedAt": "2022-02-21T15:28:43.496574Z",
40-
"primaryKey": "id"
41-
}
42-
]
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+
}
4352
```
4453

4554
## Get one index
@@ -57,7 +66,6 @@ Get information about an [index](/learn/core_concepts/indexes.md). The index [`u
5766
```json
5867
{
5968
"uid": "movies",
60-
"name": "movies",
6169
"createdAt": "2022-02-10T07:45:15.628261Z",
6270
"updatedAt": "2022-02-21T15:28:43.496574Z",
6371
"primaryKey": "id"

0 commit comments

Comments
 (0)