Database endpoints
Search a text field
Searches the full-text index of a table field by boolean match, phrase or BM25 relevance ranking.
GET /v1/tenants/{tenant}/fts/{table}/{field}
- Choose field and querySelect the indexed text to search.
- Pick the matching modeUse boolean terms, a phrase or BM25 ranking.
- Read the matching IDsInterpret scores only when that mode returns them.
Before you start
Use your database bearer token.
Index documents in the target field first. The examples search demo_docs/body.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
table | string | Required |
field | string | Required |
Query parameters
| Field | Type | Required |
|---|---|---|
q | string | Required |
mode | string | Optional |
k | integer | Optional |
fuzzy | integer | Optional |
highlight | boolean | Optional |
facets | string | Optional |
explain | boolean | Optional |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Read the result
BM25 returns ranked document IDs and scores. Boolean and phrase modes can return IDs without scores; highlight or facet options can produce an envelope. Read the response example for the mode you request instead of assuming one wire shape.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 200 | OK |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 404 | Check the resource ID and API route. |
| 408 | Reduce query work or adjust the timeout. |
| 413 | Split or reduce the request body. |
| 429 | Honor Retry-After when present; back off. |
| 499 | The client cancelled the request. |
| 500 | Check the outcome before retrying a write. |
| 501 | Check deployment support for this operation. |
| 503 | Honor Retry-After when present; check write outcomes. |