Actions24
- Documents Actions
- Indexes Actions
- Keys Actions
- Search Actions
- Settings Actions
- Tasks Actions
Overview
The Meilisearch node for n8n allows you to interact with the Meilisearch API, specifically to update index settings. The "Update Index Settings" operation under the "Settings" resource lets you configure various aspects of a Meilisearch index, such as which fields are searchable, filterable, sortable, and how typo tolerance and synonyms are handled.
Common scenarios:
- Customizing search behavior for your application by adjusting ranking rules or stop words.
- Optimizing search performance and relevance by specifying displayed, searchable, and filterable attributes.
- Managing synonyms and typo tolerance to improve user search experience.
Practical examples:
- Limiting which fields are returned in search results for privacy or performance.
- Enabling or disabling typo tolerance for specific words or attributes.
- Defining custom ranking rules to prioritize certain document attributes in search results.
Properties
Name | Meaning |
---|---|
UID | Name of the index to update. Select from existing indexes. |
Displayed Attributes | Fields displayed in the returned documents. If not specified, all fields are displayed. Example: field_one, field_two, field_three . |
Distinct Attribute | Field name for which only distinct values will be returned in search results. |
Filterable Attributes | Fields that can be used in filters. If not specified, no fields are filterable. Example: field_one, field_two, field_three . |
Max Values Per Facet | Maximum number of facet values to return for each facet during a search. Must be at least 1. Default is 100. |
Max Total Hits | Maximum number of hits to return for a search. Must be at least 1. Default is 1000. |
Ranking Rules | List of ranking rules in order of importance. Example: words, typo, proximity, attribute, sort, exactness . |
Searchable Attributes | Fields in which to search for matching query words, sorted by order of importance. Use * for all fields. Example: field_one, field_two, field_three . |
Sortable Attributes | Attributes to use when sorting search results. Example: field_one, field_two, field_three . |
Stop Words | List of words ignored by Meilisearch when present in search queries. Example: to, and, of, the . |
Typo Tolerance Enabled | Whether to enable typo tolerance (true or false ). |
Min Word Size For One Typo | Minimum word length to allow one typo. Must be at least 1. Default is 7. |
Min Word Size For Two Typos | Minimum word length to allow two typos. Must be at least 1. Default is 9. |
Disable Typo Tolerance On Words | Comma-separated list of words for which typo tolerance should be disabled. Example: word1, stuff, and, things . |
Disable Typo Tolerance On Attributes | Comma-separated list of attributes for which typo tolerance should be disabled. Example: attribute_name, other_attribute_name, attribute 3 . |
Synonyms | Groups of synonyms to define for the index. Each group includes a primary word and a comma-separated string of synonyms. Example: Primary Word: wolverine , Synonyms: xmen, logan . |
Output
The output will be a JSON object reflecting the updated settings of the specified Meilisearch index. The structure typically includes the status of the update operation and may echo back the new settings applied. Example output:
{
"taskUid": 123,
"indexUid": "my_index",
"status": "enqueued",
"type": "settingsUpdate",
"enqueuedAt": "2024-06-01T12:34:56Z"
}
- If the node supports binary data (not typical for this operation), it would represent exported settings or logs.
Dependencies
- External Service: Requires access to a running Meilisearch instance.
- API Key: Needs a valid Meilisearch API key configured in n8n credentials (
meilisearchApi
). - Environment Variable: The base URL for Meilisearch must be set in the credentials as
host_url
.
Troubleshooting
Common issues:
- Invalid Index UID: If the provided UID does not match an existing index, the operation will fail.
- Insufficient Permissions: Using an API key without sufficient privileges will result in authorization errors.
- Malformed Input: Providing incorrectly formatted attribute lists (e.g., missing commas) may cause validation errors.
Error messages and resolutions:
"Index not found"
: Ensure the UID matches an existing index."Invalid API key"
: Check that the correct API key is set in n8n credentials."Validation error"
: Review input fields for correct formatting and required values.