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 rules" operation in the Algolia node allows users to create or update multiple search rules within a specified Algolia index. Rules are conditional statements that modify search results based on defined conditions and consequences, enabling advanced curation of search behavior such as boosting certain results, filtering, or merchandising.
This operation is useful when you want to batch upload or update several rules at once, for example:
- Updating promotional rules for a product catalog.
- Managing merchandising strategies by pinning or hiding specific records.
- Automating rule updates during deployment or synchronization processes.
Practical example: You have an e-commerce site and want to promote certain products during a sale period by creating rules that boost those products' ranking. Using this operation, you can upload all these rules in one API call.
Properties
| Name | Meaning |
|---|---|
| Index Name | The name of the Algolia index where the rules will be saved. |
| Forward To Replicas | Boolean option to forward the rules update to replica indices of the main index. |
| Clear Existing Rules | Boolean option to clear all existing rules before saving the new set of rules. |
| Fixed Collection | JSON array representing the list of rules to add or replace in the index. Each rule includes its conditions, consequences, and metadata. |
Output
The output contains the response from the Algolia API after attempting to save the rules. This typically includes information about the task status or confirmation of successful rule creation/update. The output is structured as JSON data reflecting the API's response.
No binary data is produced by this operation.
Dependencies
- Requires an active Algolia account with appropriate API credentials (API key and Application ID).
- The node must be configured with these credentials to authenticate requests.
- The target Algolia index must exist or be accessible with the provided credentials.
- Network access to Algolia's API endpoints is required.
Troubleshooting
- Invalid Index Name: If the specified index does not exist or is misspelled, the API will return an error. Verify the index name is correct and accessible.
- Insufficient Permissions: Ensure the API key used has permissions to manage rules on the specified index.
- Rate Limits: Algolia enforces indexing rate limits. If exceeded, requests may fail or be throttled. Consider batching fewer rules or spacing out requests.
- Malformed Rules JSON: The rules collection must be valid JSON matching Algolia's expected schema. Invalid formatting will cause errors.
- Forward To Replicas Issues: If forwarding to replicas is enabled but replicas are misconfigured or unavailable, the operation might partially fail.
To resolve errors, check the error message returned by the API, verify credentials and permissions, and ensure the input data conforms to Algolia's rules format.