Validate synonym

Validates a synonym definition against the search engine for a given language. Each token in the synonym string is analyzed; any stop-word conflicts are reported.

This endpoint does not persist the synonym. Use it as a pre-save check: validate the definition first, and only call POST /synonym (or PUT /synonym/{id}) to save it once result is true.

Request

POST /synonym/validate

Headers

HeaderValue
AuthorizationBearer <token>
Content-Typeapplication/json

Request Body

FieldTypeRequiredDescription
synonymsstringYesThe synonym definition string (e.g. "car,automobile,vehicle" or "car => automobile").
languagestringYesThe language code to validate against (e.g. "de", "en").

Example Request

{
  "synonyms": "car,automobile,vehicle",
  "language": "de"
}

Response

Returns whether the synonym definition is valid and lists any conflicting stop words.

Response Body

FieldTypeDescription
resultbooleantrue if the synonym is valid, false if it contains stop words.
stop_wordsarrayList of synonym tokens that are stop words and therefore invalid.

Example Response

{
  "result": true,
  "stop_words": []
}

Example with stop words

{
  "result": false,
  "stop_words": ["a", "the"]
}