Meilisearch icon

Meilisearch

Consume Meilisearch API

Documents → Add or Replace Documents

AI-generated

Overview

This node operation allows users to add or replace documents in a specified Meilisearch index. It is useful for managing the content of search indexes by uploading new documents or replacing existing ones. For example, it can be used to update a product catalog or user data in a search index to keep the search results current.

Use Case Examples

  1. Adding a batch of product documents to a Meilisearch index for an e-commerce site.
  2. Replacing outdated user profile documents in a search index with updated information.

Properties

Name Meaning
Index UID The unique identifier of the Meilisearch index where documents will be added or replaced.
Primary Key Field The field name in the documents that should be used as the primary key. If the document's primary key field differs from the index's primary key, specify it here to map correctly. Leave empty if the document uses the correct primary key field name.
Documents JSON The JSON object(s) representing the documents to add or replace. Must be valid JSON. Supports single or multiple documents.
Wait for Completion Whether to wait for the indexing task to complete before returning. If enabled, the node polls the task status until it succeeds, fails, or is canceled.
Use Exponential Backoff If enabled, the polling interval for task status increases gradually 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. The interval increases by 1.5x every 5 attempts.
Max Polling Interval (ms) Maximum interval in milliseconds between polling requests when using exponential backoff.
Timeout (seconds) Maximum time in seconds to wait for task completion before timing out.

Output

JSON

  • json
    • taskUid - The unique identifier of the indexing task returned by Meilisearch.
    • status - The status of the indexing task (e.g., succeeded, failed, canceled).
    • details - Additional details about the task status or error information if the task failed.

Dependencies

  • Meilisearch API key credential

Troubleshooting

  • Ensure the 'Index UID' is correctly specified and exists in your Meilisearch instance to avoid 404 errors.
  • Validate that the 'Documents JSON' is properly formatted JSON to prevent request failures.
  • If 'Wait for Completion' is enabled, be aware of the timeout setting to avoid premature task cancellation errors.
  • Check API credentials and host URL configuration if authentication errors occur.

Links

Discussion