Algolia icon

Algolia

Use Algolia in your n8n workflows

Overview

The "Set settings" operation under the "Indices" resource allows users to update the configuration settings of a specified Algolia index. This operation is useful for customizing how search behaves on that index, including facets, ranking, typo tolerance, pagination limits, and many other advanced search parameters.

Typical use cases include:

  • Adjusting search relevance by modifying ranking criteria or custom ranking.
  • Configuring which attributes are searchable or retrievable.
  • Setting up faceting and filtering options to refine search results.
  • Enabling or disabling typo tolerance and personalization features.
  • Managing replica indices and pagination behavior.

For example, a user might want to set the "Attributes For Faceting" to enable filtering on certain product categories or adjust the "Hits Per Page" setting to control the number of search results returned per page.

Properties

Name Meaning
Index Name The name of the Algolia index whose settings will be updated.
Forward To Replicas Boolean flag indicating whether the settings update should be forwarded to replica indices.
Multiple properties Select one or more index settings to update. These include a wide range of settings such as: Attributes For Faceting, Replicas, Pagination Limited To, Unretrievable Attributes, Disable Typo Tolerance On Words, etc.
Attributes For Faceting List of attributes used for faceting (categorizing) search results. Supports modifiers like filterOnly, searchable, and afterDistinct.
Replicas List of replica indices associated with the primary index. Can include virtual replicas optimized for relevant sorting.
Pagination Limited To Maximum number of search results accessible through pagination. Higher values may slow down searches.
Unretrievable Attributes Attributes excluded from retrieval at query time, useful for ranking or access restrictions.
Disable Typo Tolerance On Words List of words requiring exact matches, disabling typo tolerance and word splitting for them.
Attributes To Transliterate Attributes supporting Japanese transliteration for searching across writing systems. Requires Japanese indexing language.
Camel Case Attributes Attributes where camel case words are split for better search matching.
Index Languages Languages used for language-specific processing like word detection and dictionaries. Always specify for best results.
Disable Prefix On Attributes Searchable attributes for which prefix matching is disabled.
Allow Compression Of Integer Array Whether arrays of non-negative integers should be compressed for performance, possibly reordering elements.
Numeric Attributes For Filtering Numeric attributes available for numerical filters. Can restrict filtering to equality only.
Separators To Index Non-alphanumeric characters to be indexed as separate words, e.g., "+", "-".
Searchable Attributes Attributes used for searching. Ordering affects ranking priority. Supports modifiers like unordered.
Custom Normalization Overrides default character normalization with custom mappings.
Attribute For Distinct Attribute used to group records for deduplication in search results.
Max Facet Hits Maximum number of facet values returned when searching for facet values.
Keep Diacritics On Characters Characters for which diacritics are preserved instead of removed.
Custom Ranking Attributes used for custom ranking of search results, with ascending or descending order modifiers.
Attributes To Retrieve Attributes included in API responses. Can specify all (*), exclude specific ones, or list explicitly.
Ranking Defines the order of ranking criteria applied to search results.
Relevancy Strictness Threshold below which less relevant results are excluded; applicable to virtual replica indices.
Attributes To Highlight Attributes to highlight in search results. Use * for all or empty array to disable.
Attributes To Snippet Attributes for which snippets (contextual excerpts) are enabled, with optional word count specification.
Highlight Pre Tag HTML tag inserted before highlighted parts.
Highlight Post Tag HTML tag inserted after highlighted parts.
Snippet Ellipsis Text String used to indicate truncated snippets.
Restrict Highlight And Snippet Arrays If true, highlights/snippets are restricted to items partially matching the query.
Hits Per Page Number of hits (results) returned per page.
Min Word Sizefor1Typo Minimum word length to allow one typo match.
Min Word Sizefor2Typos Minimum word length to allow two typos match.
Typo Tolerance Controls typo tolerance mode: boolean or detailed options like min or strict.
Allow Typos On Numeric Tokens Whether typos are allowed on numeric tokens in queries.
Disable Typo Tolerance On Attributes Attributes for which typo tolerance is disabled.
Ignore Plurals Controls plural handling: boolean, string, or array of languages.
Remove Stop Words Controls stop word removal: boolean, string, or array of languages.
Query Languages Languages used for query processing steps like plurals and stop-word removal.
Decompound Query Whether to split compound words in queries into components (supported for some languages).
Enable Rules Enables rules processing for the index.
Enable Personalization Enables personalization features.
Query Type Determines prefix search behavior: prefixLast, prefixAll, or prefixNone.
Remove Words If No Results Strategy for removing words from queries when no results are found: none, lastWords, firstWords, or allOptional.
Mode Search mode for NeuralSearch-enabled indices: neuralSearch or keywordSearch.
Semantic search object Settings for semantic search part of NeuralSearch, e.g., event sources.
Advanced Syntax Enables support for phrase matching and excluding words in queries.
Optional Words List or string of optional words in queries.
Disable Exact On Attributes Attributes for which the Exact ranking criterion is turned off.
Exact On Single Word Query How Exact ranking is computed for single-word queries: attribute, none, or word.
Alternatives As Exact Specifies which plurals and synonyms are considered exact matches.
Advanced Syntax Features Specific advanced syntax features supported, e.g., exactPhrase, excludeWords.
Distinct Controls deduplication of search results: boolean or integer specifying number of distinct groups.
Replace Synonyms In Highlight Whether to replace highlighted words with matched synonyms.
Min Proximity Minimum proximity score for two matching words affecting ranking.
Response Fields Properties included in API response to reduce size.
Max Values Per Facet Maximum number of facet values returned per facet.
Sort Facet Values By Order to retrieve facet values: count or alpha.
Attribute Criteria Computed By Min Proximity Whether best matching attribute is selected based on minimum proximity or order in searchable attributes.
Rendering Content Extra data for UI control, e.g., facet ordering, redirects, widgets.
Enable Re Ranking Enables Dynamic Re-Ranking if activated in Algolia dashboard.
Re Ranking Apply Filter Filter applied during re-ranking.

Output

The node outputs the JSON response from the Algolia API after updating the index settings. This typically includes task information confirming the update request was accepted.

The output JSON structure corresponds to Algolia's API response for the "set settings" endpoint, usually containing fields like:

  • taskID: Identifier for the asynchronous task of applying the settings.
  • status: Status of the request.
  • Other metadata related to the update operation.

No binary data is produced by this operation.

Dependencies

  • Requires an active Algolia account and an API key credential with permissions to modify index settings.
  • The node uses the Algolia REST API v1 endpoints.
  • Requires configuration of credentials with application ID and API key.
  • Network access to Algolia's servers is necessary.

Troubleshooting

  • Invalid Index Name: If the specified index does not exist, the operation may fail or create a new index depending on Algolia's API behavior.
  • Permission Errors: Insufficient API key permissions will cause authorization errors.
  • Malformed Settings: Providing invalid JSON or unsupported settings values can result in API errors.
  • Forward To Replicas: If forwarding to replicas is enabled but replicas are misconfigured, updates may not propagate correctly.
  • Rate Limits: Frequent updates may hit Algolia's rate limits, causing temporary failures.
  • Large Payloads: Sending very large settings objects may cause timeouts or errors.

To resolve errors:

  • Verify API key permissions.
  • Validate JSON input for settings.
  • Check index existence and replica configurations.
  • Review Algolia API error messages for details.

Links and References

Summary

This node operation enables comprehensive management of Algolia index settings, allowing users to tailor search behavior extensively to their application's needs. It supports a broad spectrum of configurable options, making it suitable for fine-tuning search relevance, performance, and user experience.

Discussion