You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn/getting_started/indexes.mdx
+2-15Lines changed: 2 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,8 +37,6 @@ While implicit index creation is more convenient, requiring only a single API re
37
37
38
38
The `uid` is the **unique identifier** of an index. It is set when creating the index and must be an integer or string containing only alphanumeric characters `a-z A-Z 0-9`, hyphens `-` and underscores `_`.
39
39
40
-
**Once defined, the `uid` cannot be changed**, and you cannot create another index with the same `uid`.
41
-
42
40
```json
43
41
{
44
42
"uid": "movies",
@@ -47,6 +45,8 @@ The `uid` is the **unique identifier** of an index. It is set when creating the
47
45
}
48
46
```
49
47
48
+
You can change an index's `uid` using the [`/indexes` API route](/reference/api/indexes#update-an-index).
49
+
50
50
## Primary key
51
51
52
52
Every index has a primary key: a required attribute that must be present in all documents in the index. Each document must have a unique value associated with this attribute.
@@ -61,19 +61,6 @@ You can set the primary key for an index or let it be inferred by Meilisearch. R
61
61
62
62
Index settings can be thought of as a JSON object containing many different options for customizing search behavior.
63
63
64
-
You can customize the following index settings:
65
-
66
-
-[Displayed and searchable attributes](#displayed-and-searchable-attributes)
67
-
-[Distinct attribute](#distinct-attribute)
68
-
-[Faceting](#faceting)
69
-
-[Filterable attributes](#filterable-attributes)
70
-
-[Pagination](#pagination)
71
-
-[Ranking rules](#ranking-rules)
72
-
-[Sortable attributes](#sortable-attributes)
73
-
-[Stop words](#stop-words)
74
-
-[Synonyms](#synonyms)
75
-
-[Typo tolerance](#typo-tolerance)
76
-
77
64
To change index settings, use the [update settings endpoint](/reference/api/settings#update-settings) or any of the child routes.
Copy file name to clipboardExpand all lines: reference/api/indexes.mdx
+9-17Lines changed: 9 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,10 +164,6 @@ Update an index's [primary key](/learn/getting_started/primary_key#primary-key).
164
164
165
165
To change the primary key of an index that already contains documents, you must first delete all documents in that index. You may then change the primary key and index your dataset again.
166
166
167
-
<Note>
168
-
It is not possible to change an index's `uid`.
169
-
</Note>
170
-
171
167
### Path parameters
172
168
173
169
| Name | Type | Description |
@@ -179,6 +175,7 @@ It is not possible to change an index's `uid`.
Swap the documents, settings, and task history of two or more indexes. **You can only swap indexes in pairs.**However, a single request can swap as many index pairs as you wish.
232
+
Swap the documents, settings, and task history of two or more indexes. **You can only swap indexes in pairs.**A single request can swap as many index pairs as you wish.
240
233
241
-
Swapping indexes is an atomic transaction: **either all indexes are successfully swapped, or none are.**
234
+
Swapping indexes is an atomic transaction: **either all indexes in a request are successfully swapped, or none are.** You can swap multiple pairs of indexes with a single request. To do so, there must be one object for each pair of indexes to be swapped.
242
235
243
236
Swapping `indexA` and `indexB` will also replace every mention of `indexA` by `indexB` and vice-versa in the task history. `enqueued` tasks are left unmodified.
244
237
245
238
[To learn more about index swapping, refer to this short guide.](/learn/getting_started/indexes#swapping-indexes)
246
239
247
240
### Body
248
241
249
-
An array of objects. Each object has only one key: `indexes`.
|**`indexes`**| Array of strings | N/A | Array of the two `indexUid`s to be swapped |
247
+
|**`rename`**| Boolean |`false`| If `true`, renames an index instead of swapping it |
254
248
255
249
Each `indexes` array must contain only two elements: the `indexUid`s of the two indexes to be swapped. Sending an empty array (`[]`) is valid, but no swap operation will be performed.
256
250
257
-
<Note>
258
-
You can swap multiple pairs of indexes with a single request. To do so, there must be one object for each pair of indexes to be swapped.
259
-
</Note>
251
+
Use `rename: false` if you are swapping two existing indexes. Use `rename: true` if the second index in your array does not exist.
0 commit comments