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
| Header | Value |
|---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
synonyms | string | Yes | The synonym definition string (e.g. "car,automobile,vehicle" or "car => automobile"). |
language | string | Yes | The 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
| Field | Type | Description |
|---|---|---|
result | boolean | true if the synonym is valid, false if it contains stop words. |
stop_words | array | List 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"]
}
