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 for facet values" operation in this Algolia node allows you to search for specific values within a facet attribute of an Algolia index. Facets are attributes used to categorize and filter search results, such as categories, brands, or tags. This operation is useful when you want to retrieve matching facet values based on a partial query or filter, enabling dynamic filtering options in your application.
Common scenarios include:
- Autocompleting facet filters in a UI (e.g., suggesting product categories as the user types).
- Refining search results by showing relevant facet values that match a user's input.
- Displaying popular or matching facet values for faceted navigation.
For example, if you have a "brand" facet in your product index, you can use this operation to find all brand names starting with "Sam" (like "Samsung") and display them as filter options.
Properties
| Name | Meaning |
|---|---|
| Index Name | The name of the Algolia index to search within. |
| Facet Name | The name of the facet attribute whose values you want to search. |
| Search For Facet Values Request | Select which optional parameters to include in the request body: Params, Facet Query, Max Facet Hits. |
| Params | Optional URL-encoded query string of additional search parameters (e.g., hitsPerPage=2&getRankingInfo=1). |
| Facet Query | Optional text to search inside the facet's values (partial match). |
| Max Facet Hits | Optional maximum number of facet values to return (default 10, max 100). |
Output
The node outputs the JSON response from Algolia's API for searching facet values. This typically includes:
- A list of matching facet values along with their counts (number of records containing each value).
- Metadata about the search such as processing time or query details.
The output does not include binary data; it is purely JSON structured data representing facet values and related information.
Dependencies
- Requires an Algolia account and an API key credential configured in n8n.
- The node uses the Algolia REST API endpoint
/1/indexes/{indexName}/facets/{facetName}/querywith POST method. - The base URL is constructed using the Algolia application ID from credentials.
- Proper API key permissions are required to perform facet searches.
Troubleshooting
- Invalid Index Name or Facet Name: Ensure the specified index and facet exist in your Algolia application.
- API Authentication Errors: Verify that the API key credential is correctly set up and has necessary permissions.
- Facet Limits: Searching for facet values may fail if you have more than 65 searchable facets and searchable attributes combined.
- Empty Results: If no facet values are returned, check the facet name spelling and whether the facet is configured as searchable.
- Max Facet Hits Limit: The maximum allowed value for
Max Facet Hitsis 100; exceeding this may cause errors.
Links and References
- Algolia Search for Facet Values Documentation
- Algolia API Reference - Search for Facet Values
- Faceting Guide
This summary covers the logic and usage of the "Search for facet values" operation in the Algolia node for n8n workflows.