Skip to main content
PATCH
/
network
cURL
curl \
  -X PATCH 'MEILISEARCH_URL/network' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "self": "ms-00",
    "remotes": {
      "ms-00": {
        "url": "http://INSTANCE_URL",
        "searchApiKey": "INSTANCE_API_KEY"
      },
      "ms-01": {
        "url": "http://ANOTHER_INSTANCE_URL",
        "searchApiKey": "ANOTHER_INSTANCE_API_KEY"
      }
    }
  }'
{
  "self": "ms-0",
  "remotes": {
    "ms-0": {
      "url": "http://localhost:7700",
      "searchApiKey": null,
      "writeApiKey": null
    },
    "ms-1": {
      "url": "http://localhost:7701",
      "searchApiKey": "foo",
      "writeApiKey": "bar"
    },
    "ms-2": {
      "url": "http://localhost:7702",
      "searchApiKey": "bar",
      "writeApiKey": "foo"
    }
  }
}

Authorizations

Authorization
string
header
required

An API key is a token that you provide when making API calls. Read more about how to secure your project.

Include the API key to the Authorization header, for instance:

-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'

If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:

const client = new MeiliSearch({
host: 'MEILISEARCH_URL',
apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});

Body

application/json

Network topology configuration for distributed Meilisearch

remotes
object

Map of remote instance names to their configurations

  • Pass null as a value for a remote to remove it from the configuration.
  • Removing a remote will also remove it from all shards.
  • Remotes that don't appear in this list will be unmodified by the network call.
Example:
{
"ms-00": { "url": "http://localhost:7700" },
"ms-01": { "url": "http://localhost:7701" }
}
shards
object

Map of shard names to their configurations.

  • Pass null as a value for a shard to remove it from the configuration.
  • Shards that don't appear in this list will be unmodified by the network call.
Example:
{
"shard-00": { "remotes": ["ms-00", "ms-01"] }
}
previousShards
object

Previous shard configurations

This field should not be passed by end-users. It is used in internal communications between Meilisearch instances

Example:
{
"shard-00": { "remotes": ["ms-00", "ms-01"] }
}
self
string | null

Name of this instance in the network

Example:

"ms-00"

leader
string | null

Name of the leader instance in the network

Example:

"ms-00"

previousRemotes
object

Previous remote configurations

This field should not be passed by end-users. It is used in internal communications between Meilisearch instances

Example:
{
"ms-00": { "url": "http://localhost:7700" },
"ms-01": { "url": "http://localhost:7701" }
}

Response

New network state is returned.

Network topology configuration for distributed Meilisearch

remotes
object

Map of remote instance names to their configurations

  • Pass null as a value for a remote to remove it from the configuration.
  • Removing a remote will also remove it from all shards.
  • Remotes that don't appear in this list will be unmodified by the network call.
Example:
{
"ms-00": { "url": "http://localhost:7700" },
"ms-01": { "url": "http://localhost:7701" }
}
shards
object

Map of shard names to their configurations.

  • Pass null as a value for a shard to remove it from the configuration.
  • Shards that don't appear in this list will be unmodified by the network call.
Example:
{
"shard-00": { "remotes": ["ms-00", "ms-01"] }
}
previousShards
object

Previous shard configurations

This field should not be passed by end-users. It is used in internal communications between Meilisearch instances

Example:
{
"shard-00": { "remotes": ["ms-00", "ms-01"] }
}
self
string | null

Name of this instance in the network

Example:

"ms-00"

leader
string | null

Name of the leader instance in the network

Example:

"ms-00"

previousRemotes
object

Previous remote configurations

This field should not be passed by end-users. It is used in internal communications between Meilisearch instances

Example:
{
"ms-00": { "url": "http://localhost:7700" },
"ms-01": { "url": "http://localhost:7701" }
}