Actions52
- Advanced Actions
- Api Keys Actions
- Clusters Actions
- Dictionaries Actions
- Indices Actions
- Records Actions
- Rules Actions
- Search Actions
- Synonyms Actions
- Vaults Actions
Overview
The "Search rules" operation in the Algolia node allows users to search for rules within a specified Algolia index. Rules in Algolia are conditional statements that modify search results based on certain criteria, such as boosting specific facets or promoting particular records. This operation is useful for managing and retrieving these rules programmatically, enabling dynamic curation of search results.
Common scenarios include:
- Retrieving rules that match a specific query pattern.
- Filtering rules by context or enabled status.
- Paginating through large sets of rules.
Practical example:
- A merchandiser wants to find all active rules related to mobile devices in a product catalog index to review or update them.
Properties
| Name | Meaning |
|---|---|
| Index Name | The name of the Algolia index where the rules are stored. This is required. |
| Search Rules Params | Parameters to refine the search query for rules. Options include: Query, Anchoring, Context, Page, Hits Per Page, Enabled. |
| Query | A search string to filter rules by their content. |
| Anchoring | Defines how the query pattern matches the rule's pattern. Options: is (exact match), startsWith, endsWith, contains. |
| Context | Filters rules that match a specific context exactly. |
| Page | The page number of the results to retrieve (pagination). Starts at 0. |
| Hits Per Page | Maximum number of rules to return per page. Default is 20, max 1000. |
| Enabled | Filter rules by their enabled status. Can be boolean (true for enabled, false for disabled) or null (all rules). |
Output
The output JSON contains the search results for rules matching the specified criteria. Each item represents a rule object with its properties such as conditions, consequences, description, enabled status, and validity periods.
If binary data were involved (not applicable here), it would represent associated files or media, but this operation deals solely with JSON rule objects.
Dependencies
- Requires an 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 contain rules to search.
Troubleshooting
- Empty results: Ensure the index name is correct and that rules exist matching the query parameters.
- Invalid index name: Verify the index name is spelled correctly and exists in your Algolia application.
- Authentication errors: Confirm that the API key credential has permissions to read rules from the specified index.
- Pagination issues: Remember that page numbering starts at 0; requesting a page beyond available results returns empty.
- Invalid parameter values: For example, setting hits per page above 1000 may cause errors; adhere to allowed ranges.