Skip to content

Commit

Permalink
Merge #1744
Browse files Browse the repository at this point in the history
1744: v0.28: `/indexes` changes r=maryamsulemani97 a=guimachiavelli

Closes #1701

Co-authored-by: gui machiavelli <hey@guimachiavelli.com>
  • Loading branch information
bors[bot] and guimachiavelli authored Jun 29, 2022
2 parents 13459d7 + 364fedf commit 747c0a6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .code-samples.meilisearch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down
1 change: 0 additions & 1 deletion learn/core_concepts/indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
58 changes: 33 additions & 25 deletions reference/api/indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ The `/indexes` route allows you to create, manage, and delete your indexes.

<RouteHighlighter method="GET" route="/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

Expand All @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 747c0a6

Please sign in to comment.