diff --git a/.code-samples.meilisearch.yaml b/.code-samples.meilisearch.yaml index 047cb60b9f..336bf1a25f 100644 --- a/.code-samples.meilisearch.yaml +++ b/.code-samples.meilisearch.yaml @@ -8,7 +8,7 @@ get_one_index_1: |- -X GET 'http://localhost:7700/indexes/movies' list_all_indexes_1: |- curl \ - -X GET 'http://localhost:7700/indexes' + -X GET 'http://localhost:7700/indexes?limit=3' create_an_index_1: |- curl \ -X POST 'http://localhost:7700/indexes' \ diff --git a/learn/core_concepts/indexes.md b/learn/core_concepts/indexes.md index 36f069949e..9eb84d248a 100644 --- a/learn/core_concepts/indexes.md +++ b/learn/core_concepts/indexes.md @@ -29,7 +29,6 @@ The `uid` is the **unique identifier** of an index. It is set when creating the ```json { "uid": "movies", - "name": "movies", "createdAt": "2019-11-20T09:40:33.711324Z", "updatedAt": "2019-11-20T10:16:42.761858Z" } diff --git a/reference/api/indexes.md b/reference/api/indexes.md index 4b108640d0..fb8e913a09 100644 --- a/reference/api/indexes.md +++ b/reference/api/indexes.md @@ -8,7 +8,14 @@ The `/indexes` route allows you to create, manage, and delete your indexes. -List all [indexes](/learn/core_concepts/indexes.md). +List all [indexes](/learn/core_concepts/indexes.md). Results can be paginated by using the `offset` and `limit` query parameters. + +#### Query parameters + +| Query parameter | Description | Default value | +| ------------------------ | --------------------------- | :-----------: | +| **offset** | Number of indexes to skip | 0 | +| **limit** | Number of indexes to return | 20 | ### Example @@ -17,29 +24,31 @@ List all [indexes](/learn/core_concepts/indexes.md). #### Response: `200 Ok` ```json -[ - { - "uid": "books", - "name": "books", - "createdAt": "2022-03-08T10:00:27.377346Z", - "updatedAt": "2022-03-08T10:00:27.391209Z", - "primaryKey": "id" - }, - { - "uid": "meteorites", - "name": "meteorites", - "createdAt": "2022-03-08T10:00:44.518768Z", - "updatedAt": "2022-03-08T10:00:44.582083Z", - "primaryKey": "id" - }, - { - "uid": "movies", - "name": "movies", - "createdAt": "2022-02-10T07:45:15.628261Z", - "updatedAt": "2022-02-21T15:28:43.496574Z", - "primaryKey": "id" - } -] +{ + "results": [ + { + "uid": "books", + "createdAt": "2022-03-08T10:00:27.377346Z", + "updatedAt": "2022-03-08T10:00:27.391209Z", + "primaryKey": "id" + }, + { + "uid": "meteorites", + "createdAt": "2022-03-08T10:00:44.518768Z", + "updatedAt": "2022-03-08T10:00:44.582083Z", + "primaryKey": "id" + }, + { + "uid": "movies", + "createdAt": "2022-02-10T07:45:15.628261Z", + "updatedAt": "2022-02-21T15:28:43.496574Z", + "primaryKey": "id" + } + ], + "offset": 0, + "limit": 3, + "total": 5 +} ``` ## Get one index @@ -57,7 +66,6 @@ Get information about an [index](/learn/core_concepts/indexes.md). The index [`u ```json { "uid": "movies", - "name": "movies", "createdAt": "2022-02-10T07:45:15.628261Z", "updatedAt": "2022-02-21T15:28:43.496574Z", "primaryKey": "id"