Skip to content

v0.28: /indexes changes #1744

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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