Skip to content

Commit 0886d89

Browse files
move code sample to codesamples.yaml
1 parent 960827c commit 0886d89

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

.code-samples.meilisearch.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,12 @@ webhooks_patch_1: |-
15081508
webhooks_delete_1: |-
15091509
curl \
15101510
-X DELETE 'MEILISEARCH_URL/webhooks/WEBHOOK_UUID'
1511+
rename_an_index_1: |-
1512+
curl \
1513+
-X PATCH 'MEILISEARCH_URL/indexes/INDEX_A' \
1514+
-H 'Content-Type: application/json' \
1515+
--data-binary '{ "uid": "INDEX_B" }'
1516+
15111517
15121518
### Code samples for experimental features
15131519
experimental_get_metrics_1: |-

learn/indexing/rename_an_index.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Rename an index
33
description: Use the PATCH endpoint of the /indexes route to rename an index
44
---
55

6+
import CodeSamplesRenameAnIndex1 from '/snippets/samples/code_samples_rename_an_index_1.mdx';
7+
68
This guide shows you how to change the name of an index.
79

810
## Requirements
@@ -20,11 +22,6 @@ Also choose the new name you wish to assign the index. This guide uses `INDEX_B`
2022

2123
Send a `PATCH` request targeting the index you want to rename:
2224

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-
```
25+
<CodeSamplesRenameAnIndex1 />
2926

3027
Replace `INDEX_A` with the current name of your index, and `INDEX_B` with its new name.

0 commit comments

Comments
 (0)