Skip to main content

Documentation Index

Fetch the complete documentation index at: https://algolia.com/llms.txt

Use this file to discover all available pages before exploring further.

The replaceSynonymsInHighlight parameter controls whether highlights and snippets display the synonym used in the query or the original word from the record. For example, with "home" as a synonym for "house":
  • A query for "home" matches records containing "house".
  • If this parameter is true, the search response shows "home" in both highlights and snippets.
  • If this parameter is false, highlights and snippets show the original word from the record, "house".

Usage

  • One-word synonyms can replace multi-word values in the output. However, multi-word queries don’t replace shorter synonyms. For example, if "NYC" and "New York City" are synonyms:
    • A query for "NYC" will replace "New York City" in the highlights.
    • A query for "New York City" won’t replace "NYC" in the highlights.

Example

Current API clients

var response = await client.SetSettingsAsync(
  "INDEX_NAME",
  new IndexSettings { ReplaceSynonymsInHighlight = false }
);
IndexSettings settings = new IndexSettings();
settings.ReplaceSynonymsInHighlight = false;

index.SetSettings(settings);
Last modified on March 16, 2026