Skip to content

Commit e914130

Browse files
committed
feat: Adding support for index renaming.
1 parent 1f6ee1a commit e914130

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

meilisearch/index.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,15 @@ def update(self, primary_key: Optional[str] = None, new_uid: Optional[str] = Non
114114
new_uid : str, optional
115115
The new UID to rename the index.
116116
117+
Renaming behavior
118+
-----------------
119+
When ``new_uid`` is provided, this method sends a PATCH request to rename
120+
the index. After the task completes, the index exists under the new UID,
121+
but this ``Index`` instance still contains the old ``self.uid``, making it
122+
**stale**. Further operations with this instance will fail until a fresh
123+
instance is obtained. After the rename task completes, obtain a new ``Index``
124+
instance via ``client.index(new_uid)`` before making further requests.
125+
117126
Returns
118127
-------
119128
task_info:

0 commit comments

Comments
 (0)