Actions24
- Documents Actions
- Indexes Actions
- Keys Actions
- Search Actions
- Settings Actions
- Tasks Actions
Overview
The Swap Indexes operation for the "Indexes" resource in this custom n8n Meilisearch node allows users to swap the unique identifiers (UIDs) of two or more indexes within a Meilisearch instance. This is particularly useful when you want to atomically replace one index with another, such as during zero-downtime reindexing or blue-green deployments. For example, after building a new version of an index, you can swap it with the live one so that search queries immediately use the updated data.
Practical scenarios:
- Seamlessly updating production indexes without downtime.
- Rolling back to a previous index version by swapping UIDs.
- Managing A/B testing between different index versions.
Properties
Name | Meaning |
---|---|
Index Pairs | One or more pairs of indexes to swap. Each pair consists of: |
- Index 1 UID: The UID string for the first index in the pair. | |
- Index 2 UID: The UID string for the second index in the pair. |
Output
The output will typically be a JSON object containing the result of the swap operation. This may include:
- Task information (such as task ID, status, and details about the swap).
- Confirmation that the specified index UIDs have been swapped.
Example output structure:
{
"taskUid": 123,
"status": "enqueued",
"type": "swapIndexes",
"details": {
"swaps": [
{ "indexes": ["indexA", "indexB"] }
]
}
}
Dependencies
- External Service: Requires access to a running Meilisearch instance.
- API Key: Needs a valid Meilisearch API key with sufficient permissions to perform index swaps.
- n8n Credentials: Must configure the
meilisearchApi
credential in n8n, including the host URL and API key.
Troubleshooting
Common issues:
- Invalid UIDs: If either of the provided index UIDs does not exist, the operation will fail.
- Insufficient Permissions: Using an API key without the necessary rights will result in authorization errors.
- Network Issues: Connectivity problems with the Meilisearch server will cause request failures.
Common error messages and resolutions:
"Index not found"
: Ensure both UIDs are correct and the indexes exist."Invalid API key"
or"Unauthorized"
: Check your API key and its permissions."Connection refused"
: Verify the Meilisearch host URL and network connectivity.