Meilisearch icon

Meilisearch

Consume Meilisearch API

Overview

The "Delete All Document" operation for the "Documents" resource in this custom n8n node is designed to remove all documents from a specified index in a Meilisearch instance. This operation is useful when you need to clear out an entire dataset from an index, such as resetting test data, purging outdated records, or preparing an index for a fresh import.

Practical examples:

  • Clearing all user profiles from a "users" index before importing updated data.
  • Removing all product listings from a "products" index after a catalog update.
  • Resetting a search index during development or testing phases.

Properties

Name Meaning
Index UID Name of the index from which all documents will be deleted. Options are dynamically loaded from your Meilisearch instance and display both the UID and primary key of each index.

Output

The output will typically include a JSON object indicating the result of the delete operation. While the exact structure may depend on the Meilisearch API response, it usually contains information such as:

{
  "taskUid": 123,
  "indexUid": "your_index",
  "status": "enqueued",
  "type": "documentDeletion",
  "enqueuedAt": "2023-01-01T12:00:00Z"
}
  • taskUid: The unique identifier for the deletion task.
  • indexUid: The UID of the affected index.
  • status: The status of the task (e.g., "enqueued").
  • type: The type of operation performed.
  • enqueuedAt: Timestamp when the task was enqueued.

Dependencies

  • External Service: Requires access to a running Meilisearch instance.
  • API Key: You must configure valid Meilisearch API credentials (meilisearchApi) in n8n.
  • Environment Variable: The base URL for Meilisearch is set via the credential property host_url.

Troubleshooting

Common Issues:

  • Invalid Index UID: If the selected index does not exist, the operation will fail. Ensure the index exists in your Meilisearch instance.
  • Insufficient Permissions: The provided API key must have permission to delete documents. Otherwise, you may receive authorization errors.
  • Connection Errors: If n8n cannot reach the Meilisearch server (wrong URL, network issues), the operation will fail.

Common Error Messages:

  • "Index not found": Check that the correct Index UID is selected.
  • "Invalid API key" or "Permission denied": Verify your API key has the necessary permissions.
  • "Network error": Ensure the Meilisearch host URL is correct and reachable from n8n.

Links and References

Discussion