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
description: This guide walks you through implemnting a sharding strategy by activating the `/network` route, configuring the network object, and performing remote federated searches.
4
4
---
5
5
6
-
# Implement sharding with remote federated search
6
+
# Implement sharding with remote federated search <NoticeTagtype="experimental"label="experimental" />
7
7
8
8
Sharding is the process of splitting an index containing many documents into multiple smaller indexes, often called shards. This horizontal scaling technique is useful when handling large databases. In Meilisearch, the best way to implement a sharding strategy is to use remote federated search.
9
9
@@ -36,14 +36,14 @@ Meilisearch should respond immediately, confirming the route is now accessible.
36
36
37
37
## Configuring the network object
38
38
39
-
The network object consists of the following fields:
39
+
Next, you must configure the network object. It consists of the following fields:
40
40
41
-
-`remotes`: a list with the required information to access each remote instance
42
-
-`self`: specifies which of configured remotes corresponds to the current instance
41
+
-`remotes`: defines a list with the required information to access each remote instance
42
+
-`self`: specifies which of the configured `remotes` corresponds to the current instance
43
43
44
44
### Setting up remote instances
45
45
46
-
Next, configure the `remotes` field of the network object:
46
+
Use the `/network` route to configure the `remotes` field of the network object. `remotes` should be an object containing one or more objects. Each one of the nested objects should consist of the name of each instance, associated with its URL and an API key with search permission:
47
47
48
48
```sh
49
49
curl \
@@ -68,8 +68,6 @@ curl \
68
68
}'
69
69
```
70
70
71
-
Each object should consist of the name of each instance, associated with its URL and an API key with search permission.
72
-
73
71
Configure the entire set of remote instances in your sharded database, making sure to send the same remotes to each instance.
74
72
75
73
### Specify the name of the current instance
@@ -112,7 +110,7 @@ If your disk space allows, you can reduce the downtime by applying the following
112
110
113
111
Create the same empty indexes with the same settings on all instances. Keeping the settings and indexes in sync is important to avoid errors and unexpected behavior, though not strictly required.
114
112
115
-
Distribute your documents across all instances. Do not send same document **to multiple instances**, as this may lead to duplicate search results. Similarly, you should ensure all future versions of a document are sent to the same instance. Meilisearch recommends you hash their primary key using [rendezvous hashing](https://en.wikipedia.org/wiki/Rendezvous_hashing).
113
+
Distribute your documents across all instances. Do not send the same document to multiple instances as this may lead to duplicate search results. Similarly, you should ensure all future versions of a document are sent to the same instance. Meilisearch recommends you hash their primary key using [rendezvous hashing](https://en.wikipedia.org/wiki/Rendezvous_hashing).
Copy file name to clipboardExpand all lines: reference/api/network.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ This feature is not available for Meilisearch Cloud users.
26
26
27
27
```json
28
28
{
29
-
"self": "ms-00",
29
+
"self": "ms-00",
30
30
"remotes": {
31
31
"ms-00": {
32
32
"url": "http://ms-1235.example.meilisearch.io",
@@ -50,7 +50,7 @@ This feature is not available for Meilisearch Cloud users.
50
50
51
51
**Type**: Object<br />
52
52
**Default value**: `{}`<br />
53
-
**Description**: An object containing `remote` objects. The key of each remote object indicates the name of the remote instance
53
+
**Description**: An object containing [remote objects](#the-remote-object). The key of each remote object indicates the name of the remote instance
54
54
55
55
#### The remote object
56
56
@@ -65,7 +65,7 @@ This feature is not available for Meilisearch Cloud users.
65
65
66
66
**Type**: String<br />
67
67
**Default value**: `null`<br />
68
-
**Description**: URL indicating the address of a Meilisearch instance. This URL does not need to be public, but must be accessible to all instances in the network. Required.
68
+
**Description**: URL indicating the address of a Meilisearch instance. This URL does not need to be public, but must be accessible to all instances in the network. Required
69
69
70
70
##### `searchApiKey`
71
71
@@ -87,7 +87,7 @@ Returns the current value of the instance's network object.
0 commit comments