Meilisearch icon

Meilisearch

Consume Meilisearch API

Indexes → Swap Indexes

AI-generated

Overview

This node operation swaps two indexes in Meilisearch by specifying pairs of index UIDs to be swapped. It is useful in scenarios where you want to atomically switch the roles or data of two indexes without downtime, such as during index updates or migrations. The node supports waiting for the swap task to complete, with options for polling intervals and exponential backoff to efficiently monitor task status.

Use Case Examples

  1. Swapping two indexes to update search data without downtime.
  2. Automating index role changes in a Meilisearch setup.

Properties

Name Meaning
Index Pairs Pairs of index UIDs to be swapped, each pair containing two UIDs representing the indexes to swap.
Wait for Completion Whether to wait for the swap task to complete before returning, enabling synchronous operation.
Use Exponential Backoff If enabled, the polling interval for checking task status increases exponentially to reduce API calls during waiting.
Polling Interval (ms) Fixed interval in milliseconds between polling requests when exponential backoff is disabled.
Initial Polling Interval (ms) Starting interval in milliseconds between polling requests when exponential backoff is enabled; interval increases by 1.5x every 5 attempts.
Max Polling Interval (ms) Maximum interval in milliseconds between polling requests when using exponential backoff; polling interval will not exceed this value.
Timeout (seconds) Maximum time in seconds to wait for the swap task to complete before timing out.

Output

JSON

  • json
    • status - The status of the swap task, indicating if it succeeded, failed, or was canceled.
    • taskUid - The unique identifier of the swap task.
    • details - Additional details about the swap task result or error information if the task failed.

Dependencies

  • Meilisearch API key credential

Troubleshooting

  • If the task does not complete within the specified timeout, a timeout error is thrown. Increase the timeout or check the Meilisearch server status.
  • If the node fails to authenticate, verify the Meilisearch API credentials and host URL configuration.
  • Polling may fail if network issues occur; ensure stable connectivity to the Meilisearch server.

Links

Discussion