Skip to content

Commit 400533a

Browse files
add short guide
1 parent 2c05f1f commit 400533a

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@
277277
{
278278
"group": "Indexing",
279279
"pages": [
280+
"learn/indexing/rename_an_index",
280281
"learn/indexing/indexing_best_practices",
281282
"learn/indexing/ram_multithreading_performance",
282283
"learn/indexing/tokenization"

learn/indexing/rename_an_index.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: Rename an index
3+
description: Use the PATCH endpoint of the /indexes route to rename an index
4+
---
5+
6+
This guide shows you how to change the name of an index.
7+
8+
## Requirements
9+
10+
- A Meilisearch project with at least one index
11+
- A command-line terminal
12+
13+
## Choose the target index and its new name
14+
15+
Decide which index you want to rename and keep note of its `uid`. This guide changes the name of an index called `INDEX_A`.
16+
17+
Also choose the new name you wish to assign the index. This guide uses `INDEX_B` for the new name of the index.
18+
19+
## Query the `/indexes/{index_uid}` route
20+
21+
Send a `PATCH` request targeting the index you want to rename:
22+
23+
```sh
24+
curl \
25+
-X PATCH 'MEILISEARCH_URL/indexes/INDEX_A' \
26+
-H 'Content-Type: application/json' \
27+
--data-binary '{ "uid": "INDEX_B" }'
28+
```
29+
30+
Replace `INDEX_A` with the current name of your index, and `INDEX_B` with its new name.

0 commit comments

Comments
 (0)