Meilisearch icon

Meilisearch

Consume Meilisearch API

Overview

The Meilisearch node for n8n allows you to interact with a Meilisearch instance, specifically to retrieve documents from a specified index. The "Get Documents" operation under the "Documents" resource fetches multiple documents from a chosen index, supporting pagination and field selection. This is useful for scenarios where you need to extract data stored in Meilisearch for further processing, reporting, or integration with other systems.

Practical examples:

  • Fetching all user profiles stored in a Meilisearch index for analysis.
  • Retrieving a subset of product records for display in a dashboard.
  • Exporting filtered document data to another service or workflow.

Properties

Name Meaning
Index UID Name of the index from which to retrieve documents. You select this from available indexes (auto-loaded).
Additional Fields Collection of optional parameters to refine your query:
- Offset: Number of results to skip (for pagination).
- Limit: Maximum number of results to return.
- Fields: Comma-separated list of fields to include in the response.

Output

  • The output is a JSON array of document objects retrieved from the specified index.
  • Each object represents a document as stored in Meilisearch, containing the fields requested (or all fields if none are specified).
  • No binary data is produced by this operation.

Example output:

[
  {
    "id": 1,
    "title": "Document Title",
    "content": "Document content...",
    // ...other fields
  },
  {
    "id": 2,
    "title": "Another Document",
    "content": "More content...",
    // ...other fields
  }
]

Dependencies

  • External Service: Requires access to a running Meilisearch instance.
  • API Key: Needs valid Meilisearch API credentials configured in n8n (meilisearchApi).
  • Environment Variable: The base URL for Meilisearch must be set in the credentials (host_url).

Troubleshooting

  • Invalid Credentials: If the API key or host URL is incorrect, you may receive authentication errors. Double-check your Meilisearch credentials in n8n.
  • Index Not Found: If the selected Index UID does not exist, an error will occur. Ensure the index exists in your Meilisearch instance.
  • Field Selection Errors: Specifying non-existent fields in the "Fields" property may result in empty or partial responses.
  • Pagination Issues: Setting Offset or Limit to invalid values (e.g., negative numbers) may cause errors or unexpected results.

Links and References

Discussion