Skip to content

Commit 09831b7

Browse files
committed
Update network and remote objects
1 parent 7d6ed21 commit 09831b7

File tree

2 files changed

+36
-10
lines changed

2 files changed

+36
-10
lines changed

reference/api/network.mdx

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@ Do not enable the `network` feature if you rely on the value of attributes not p
4040
```json
4141
{
4242
"self": "ms-00",
43+
"sharding": false,
4344
"remotes": {
4445
"ms-00": {
4546
"url": "http://ms-1235.example.meilisearch.io",
46-
"searchApiKey": "Ecd1SDDi4pqdJD6qYLxD3y7VZAEb4d9j6LJgt4d6xas"
47+
"searchApiKey": "Ecd1SDDi4pqdJD6qYLxD3y7VZAEb4d9j6LJgt4d6xas",
48+
"writeApiKey": "O2OaIHgwGuHNx9duH6kSe1YJ55Bh0dXvLhbr8FQVvr3vRVViBO"
4749
},
4850
"ms-01": {
4951
"url": "http://ms-4242.example.meilisearch.io",
50-
"searchApiKey": "hrVu-OMcjPGElK7692K7bwriBoGyHXTMvB5NmZkMKqQ"
52+
"searchApiKey": "hrVu-OMcjPGElK7692K7bwriBoGyHXTMvB5NmZkMKqQ",
53+
"writeApiKey": "bd1ldDoFlfyeoFDe8f3GVNiE8AHX86chmFuzOW7nWYUbPa7ww3"
5154
}
5255
}
5356
}
@@ -59,6 +62,12 @@ Do not enable the `network` feature if you rely on the value of attributes not p
5962
**Default value**: `null`<br />
6063
**Description**: A string indicating the name of the current instance
6164

65+
### `sharding`
66+
67+
**Type**: Boolean<br />
68+
**Default value**: `false`<br />
69+
**Description**: A boolean indicating whether sharding should be enabled on the network
70+
6271
### `remotes`
6372

6473
**Type**: Object<br />
@@ -70,7 +79,8 @@ Do not enable the `network` feature if you rely on the value of attributes not p
7079
```json
7180
"ms-00": {
7281
"url": "http://ms-1235.example.meilisearch.io",
73-
"searchApiKey": "Ecd1SDDi4pqdJD6qYLxD3y7VZAEb4d9j6LJgt4d6xas"
82+
"searchApiKey": "Ecd1SDDi4pqdJD6qYLxD3y7VZAEb4d9j6LJgt4d6xas",
83+
"writeApiKey": "O2OaIHgwGuHNx9duH6kSe1YJ55Bh0dXvLhbr8FQVvr3vRVViBO"
7484
}
7585
```
7686

@@ -86,6 +96,12 @@ Do not enable the `network` feature if you rely on the value of attributes not p
8696
**Default value**: `null`<br />
8797
**Description**: An API key with search permissions
8898

99+
##### `writeApiKey`
100+
101+
**Type**: String<br />
102+
**Default value**: `null`<br />
103+
**Description**: An API key with `documents.*` permissions
104+
89105
## Get the network object
90106

91107
<RouteHighlighter method="GET" path="/network"/>
@@ -101,14 +117,17 @@ Returns the current value of the instance's network object.
101117
```json
102118
{
103119
"self": "ms-00",
120+
"sharding": false,
104121
"remotes": {
105122
"ms-00": {
106123
"url": "http://ms-1235.example.meilisearch.io",
107-
"searchApiKey": "Ecd1SDDi4pqdJD6qYLxD3y7VZAEb4d9j6LJgt4d6xas"
124+
"searchApiKey": "Ecd1SDDi4pqdJD6qYLxD3y7VZAEb4d9j6LJgt4d6xas",
125+
"writeApiKey": "O2OaIHgwGuHNx9duH6kSe1YJ55Bh0dXvLhbr8FQVvr3vRVViBO"
108126
},
109127
"ms-01": {
110128
"url": "http://ms-4242.example.meilisearch.io",
111-
"searchApiKey": "hrVu-OMcjPGElK7692K7bwriBoGyHXTMvB5NmZkMKqQ"
129+
"searchApiKey": "hrVu-OMcjPGElK7692K7bwriBoGyHXTMvB5NmZkMKqQ",
130+
"writeApiKey": "bd1ldDoFlfyeoFDe8f3GVNiE8AHX86chmFuzOW7nWYUbPa7ww3"
112131
}
113132
}
114133
}
@@ -122,13 +141,14 @@ Update the `self` and `remotes` fields of the network object.
122141

123142
Updates to the network object are **partial**. Only provide the fields you intend to update. Fields not present in the payload will remain unchanged.
124143

125-
To reset `self` and `remotes` to their original value, set them to `null`. To remove a single `remote` from your network, set the value of its name to `null`.
144+
To reset `self`, `sharding` and `remotes` to their original value, set them to `null`. To remove a single `remote` from your network, set the value of its name to `null`.
126145

127146
### Body
128147

129148
| Name | Type | Default value | Description |
130149
| :-------------------------------- | :----- | :------------ | :---------------------------------- |
131150
| **[`self`](#self)** | String | `null` | The name of the current instance |
151+
| **[`sharding`](#sharding)** | Boolean| `false` | Whether sharding should be enabled on the network |
132152
| **[`remotes`](#remotes)** | String | `null` | A list of remote objects describing accessible Meilisearch instances |
133153

134154
### Example
@@ -140,14 +160,17 @@ To reset `self` and `remotes` to their original value, set them to `null`. To re
140160
```json
141161
{
142162
"self": "ms-00",
163+
"sharding": true,
143164
"remotes": {
144165
"ms-00": {
145166
"url": "http://INSTANCE_URL",
146-
"searchApiKey": "INSTANCE_API_KEY"
167+
"searchApiKey": "INSTANCE_API_KEY",
168+
"writeApiKey": "INSTANCE_WRITE_API_KEY"
147169
},
148170
"ms-01": {
149171
"url": "http://ANOTHER_INSTANCE_URL",
150-
"searchApiKey": "ANOTHER_INSTANCE_API_KEY"
172+
"searchApiKey": "ANOTHER_INSTANCE_API_KEY",
173+
"writeApiKey": "ANOTHER_INSTANCE_WRITE_API_KEY"
151174
}
152175
}
153176
}

snippets/samples/code_samples_update_network_1.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ curl \
66
-H 'Content-Type: application/json' \
77
--data-binary '{
88
"self": "ms-00",
9+
"sharding": true,
910
"remotes": {
1011
"ms-00": {
1112
"url": "http://INSTANCE_URL",
12-
"searchApiKey": "INSTANCE_API_KEY"
13+
"searchApiKey": "INSTANCE_API_KEY",
14+
"writeApiKey": "INSTANCE_WRITE_API_KEY"
1315
},
1416
"ms-01": {
1517
"url": "http://ANOTHER_INSTANCE_URL",
16-
"searchApiKey": "ANOTHER_INSTANCE_API_KEY"
18+
"searchApiKey": "ANOTHER_INSTANCE_API_KEY",
19+
"writeApiKey": "ANOTHER_INSTANCE_WRITE_API_KEY"
1720
}
1821
}
1922
}'

0 commit comments

Comments
 (0)