Skip to main content
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 do not 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

IndexSettings settings = new IndexSettings();
settings.ReplaceSynonymsInHighlight = false;

index.SetSettings(settings);
IndexSettings settings = new IndexSettings();
settings.ReplaceSynonymsInHighlight = false;

index.SetSettings(settings);
I