An index is an entity that gathers a set of documents with its own settings.
List all indexes.
[
{
"uid": "movies",
"primaryKey": "movie_id",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T10:16:42.761858Z"
},
{
"uid": "movie_reviews",
"primaryKey": null,
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T10:16:42.761858Z"
}
]
Get information about an index.
Variable | Description |
---|---|
index_uid | The index UID |
{
"uid": "movies",
"primaryKey": "movie_id",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T10:16:42.761858Z"
}
Create an index.
This route takes as parameter an unique uid
and optionally the primary key.
::: note An index is automatically created when adding documents or settings to an index that does not already exist. :::
Variable | Description |
---|---|
index_uid | The index unique identifier (mandatory) |
primaryKey | The of the documents |
{
"uid": "movies",
"primaryKey": "movie_id"
}
{
"uid": "movies",
"primaryKey": "movie_id",
"createdAt": "2019-11-20T09:40:33.711476Z",
"updatedAt": "2019-11-20T09:40:33.711476Z"
}
Update an index.
Variable | Description |
---|---|
index_uid | The index UID |
Variable | Description |
---|---|
primaryKey | The of the documents |
The uid
of an index cannot be changed.
The primaryKey
can be added if it does not already exist (to know if it has been set, use the get index route).
There are many ways in MeiliSearch to set the primary key.
{
"uid": "movie_review",
"primaryKey": "movie_review_id",
"createdAt": "2019-11-20T09:40:33.711324Z",
"updatedAt": "2019-11-20T10:16:42.761858Z"
}
Delete an index.
Variable | Description |
---|---|
index_uid | The index UID |