Overview
Synonyms allow you to expand search queries so that related terms find the same products. When a user searches for “tenis”, the search engine can also match “sneaker” and “calcado esportivo” without requiring those exact words in the product catalog. Synonyms are applied automatically during query understanding, before embedding generation. They are cached per workspace with a 5-minute TTL for performance.Synonym Types
| Type | Behavior | Example |
|---|---|---|
regular | Bidirectional — A and B are equivalent | ”tenis” ↔ “sneaker” |
one_way | Unidirectional — A expands to B (but not vice versa) | “calcados” → “tenis”, “sapatos” |
Authentication
All requests require an API key via thex-api-key header. The workspace is resolved from the key.
List Synonyms
Create Synonym
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
type | string | Yes | regular or one_way |
inputTerms | string[] | Yes | One or more source terms (minimum 1) |
expandedTerms | string[] | Yes | One or more target terms (minimum 1) |
201 Created
Update Synonym
200 OK with updated synonym record.
Returns 404 if the synonym ID does not belong to the workspace (workspace isolation enforced).
Delete Synonym
204 No Content on success. 404 if not found.