Actions52
- Advanced Actions
- Api Keys Actions
- Clusters Actions
- Dictionaries Actions
- Indices Actions
- Records Actions
- Rules Actions
- Search Actions
- Synonyms Actions
- Vaults Actions
Overview
The "Save synonym" operation in the Synonyms resource allows users to add or update a synonym object in an Algolia index. If a synonym with the specified object ID does not exist, it creates a new one; otherwise, it replaces the existing synonym. This operation is useful for managing search synonyms to improve search relevance and user experience by defining terms that should be considered equivalent during searches.
Common scenarios:
- Adding new synonyms to enhance search results.
- Updating existing synonyms to refine search behavior.
- Managing one-way synonyms, alternative corrections, placeholders, and replacements to tailor search queries.
Practical example:
You have an e-commerce site where "car" and "automobile" should be treated as equivalent search terms. Using this node, you can save a synonym object linking these terms so that a search for either returns relevant results.
Properties
| Name | Meaning |
|---|---|
| Index Name | The name of the Algolia index where the synonym will be saved. |
| Object ID | Unique identifier for the synonym object. |
| Forward To Replicas | Boolean flag indicating whether the synonym update should be forwarded to replica indices. |
| Multiple properties | Select which properties to include in the synonym object. Options include: |
| - Object ID | Unique identifier of the synonym object. |
| - Type | Type of synonym. Options: synonym, onewaysynonym, altcorrection1, altcorrection2, placeholder, oneWaySynonym, altCorrection1, altCorrection2. |
| - Synonyms | Array of words or phrases considered equivalent. |
| - Input | Word or phrase to appear in query strings (used for one-way synonyms). |
| - Word | Word or phrase to appear in query strings (used for alternative corrections). |
| - Corrections | Array of words to be matched in records (for alternative corrections). |
| - Placeholder | Placeholder token to be put inside records. |
| - Replacements | Array of query words that match the placeholder token. |
Output
The node outputs the response from the Algolia API after saving the synonym. The output JSON typically contains details about the saved synonym object, including its object ID and any metadata returned by Algolia. There is no binary data output for this operation.
Dependencies
- Requires an Algolia account and an API key credential configured in n8n.
- The node uses the Algolia REST API endpoint for synonyms management.
- Requires the Algolia application ID and API key to authenticate requests.
- The index specified must exist in the Algolia application.
Troubleshooting
- Missing or invalid API credentials: Ensure that the Algolia API key and application ID are correctly configured in n8n.
- Invalid index name: Verify that the index name exists and is correctly spelled.
- Object ID conflicts: If the object ID already exists, the synonym will be replaced; ensure this is intended.
- Incorrect property types: For JSON properties like synonyms, corrections, and replacements, ensure valid JSON arrays are provided.
- Forward to replicas issues: If forwarding to replicas is enabled but replicas do not exist or are misconfigured, updates may fail or not propagate.
- API rate limits: Be aware of Algolia's indexing rate limits; excessive requests may result in errors.