{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/algolia/main/json-schema/algolia-synonym-hit-schema.json",
  "title": "synonymHit",
  "description": "Synonym object.",
  "x-generated": "2026-09-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/algolia-search-api-openapi.yml#/components/schemas/synonymHit",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "objectID": {
      "type": "string",
      "description": "Unique identifier of a synonym object."
    },
    "type": {
      "$ref": "#/$defs/SynonymType"
    },
    "synonyms": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Words or phrases considered equivalent."
    },
    "input": {
      "type": "string",
      "description": "Word or phrase to appear in query strings (for [`onewaysynonym`s](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/one-way-synonyms))."
    },
    "word": {
      "type": "string",
      "description": "Word or phrase to appear in query strings (for [`altcorrection1` and `altcorrection2`](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-alternative-corrections))."
    },
    "corrections": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Words to be matched in records."
    },
    "placeholder": {
      "type": "string",
      "description": "[Placeholder token](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-placeholders) to be put inside records.\n"
    },
    "replacements": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Query words that will match the [placeholder token](https://www.algolia.com/doc/guides/managing-results/optimize-search-results/adding-synonyms/in-depth/synonyms-placeholders)."
    }
  },
  "required": [
    "objectID",
    "type"
  ],
  "$defs": {
    "SynonymType": {
      "type": "string",
      "description": "Synonym type.",
      "enum": [
        "synonym",
        "onewaysynonym",
        "altcorrection1",
        "altcorrection2",
        "placeholder",
        "oneWaySynonym",
        "altCorrection1",
        "altCorrection2"
      ]
    }
  }
}