Algolia icon

Algolia

Use Algolia in your n8n workflows

Overview

The "Save synonyms" operation in the Algolia node allows users to add or update multiple synonym objects in a specified Algolia index. If a synonym with a given objectID does not exist, it will be created; if it exists, it will be replaced. This operation is useful for managing search synonyms in bulk, improving search relevance by defining terms that should be considered equivalent during searches.

Common scenarios include:

  • Bulk uploading synonyms for product catalogs to enhance search results.
  • Updating existing synonyms to refine search behavior.
  • Replacing all synonyms in an index with a new set.

Example use case:
A retailer wants to ensure that searches for "sneakers" also return results for "trainers" and "running shoes". They can use this operation to save a batch of synonyms mapping these terms together.

Properties

Name Meaning
Index Name The name of the Algolia index where synonyms will be saved.
Forward To Replicas Boolean option to forward the synonym changes to replica indices of the main index.
Replace Existing Synonyms Boolean option to replace all existing synonyms in the index with the provided batch.
Fixed Collection A JSON collection representing the list of synonym objects to save (matching synonyms).

Output

The output contains the response from the Algolia API after attempting to save the batch of synonyms. It typically includes information about the task status or confirmation of the operation's success.

If the node supports binary data output, it would represent any binary content returned by the API, but for this operation, the output is JSON-based.

Dependencies

  • Requires an Algolia application ID and an API key credential with permissions to manage synonyms on the specified index.
  • The node uses Algolia's REST API endpoint for batch saving synonyms.
  • Proper configuration of the base URL using the Algolia app ID is necessary.

Troubleshooting

  • Invalid Index Name: Ensure the specified index name exists in your Algolia application.
  • Insufficient Permissions: The API key used must have rights to modify synonyms.
  • Malformed Synonym Objects: The synonyms JSON must conform to Algolia's expected format.
  • Rate Limits: Batch operations are subject to Algolia's indexing rate limits; exceeding them may cause errors.
  • Forwarding to Replicas: If forwarding is enabled but replicas do not exist or are misconfigured, the operation might fail or behave unexpectedly.

To resolve errors:

  • Verify credentials and permissions.
  • Validate the synonyms JSON structure.
  • Check Algolia dashboard for rate limit usage.
  • Confirm replica indices setup if forwarding is enabled.

Links and References

Discussion