Synonyms — MDDB API
FTS synonym dictionary management
List synonyms #
GET /v1/synonyms
List all synonym entries for a collection. Synonyms are used to expand FTS queries with related terms.
Authorization: BearerAuth or APIKeyAuth or none
Parameters #
| Name | In | Type | Description |
|---|---|---|---|
collection (required) |
query | string |
Collection name |
Responses #
| Status | Description | Body |
|---|---|---|
200 |
Synonym list retrieved successfully | SynonymListResponse (application/json) |
400 |
Invalid request (missing collection parameter) | ErrorResponse (application/json) |
Add or update synonym group #
POST /v1/synonyms
Add or update a synonym mapping for a term in a collection. Synonyms are bidirectional -- if "big" has synonym "large", then querying "large" will also expand to include "big".
Authorization: BearerAuth or APIKeyAuth or none
Request body #
Required.
Content type application/json: SynonymRequest
{
"collection": "blog",
"synonyms": [
"large",
"huge",
"enormous"
],
"term": "big"
}
Responses #
| Status | Description | Body |
|---|---|---|
200 |
Synonym group set successfully | object (application/json) |
400 |
Invalid request | ErrorResponse (application/json) |
Delete synonym group #
DELETE /v1/synonyms
Delete a synonym mapping for a term in a collection.
Authorization: BearerAuth or APIKeyAuth or none
Request body #
Required.
Content type application/json: SynonymDeleteRequest
{
"collection": "blog",
"term": "big"
}
Responses #
| Status | Description | Body |
|---|---|---|
200 |
Synonym group deleted successfully | object (application/json) |
400 |
Invalid request | ErrorResponse (application/json) |