Database endpoints
Search dense + sparse
Search dense and sparse vectors together, then combine the rankings with Reciprocal Rank Fusion.
POST /v1/tenants/{tenant}/vector/{table}/topk_hybrid
- Prepare both query representationsSupply dense coordinates and sparse positions with values.
- Combine ranked candidatesUse Reciprocal Rank Fusion across the two searches.
- Read the fused resultInterpret its score as fusion, not cosine similarity.
Before you start
Use your database bearer token.
Index dense and sparse vectors under the same record IDs before combining their search results.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
table | string | Required |
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. |
Request body
application/json
Limits and accepted values
- rrf_k defaults to 60;
- candidates (per-leg overfetch) defaults to max(4k, 40) and is never below k.
- dense_mode: fast | high_recall.
- `filter` is a strict-equality metadata map ({field: value});
- `filter_expr` is the typed operator filter (e.g. {"tag": {"$eq": "a"}}) and cannot be combined with a non-empty `filter`;
- `require_complete: true` turns an underfilled filtered answer into a 422.
| Field | Type | Required |
|---|---|---|
candidates | integer | Optional |
dense_dim | integer | Required |
dense_metric | string | Optional |
dense_mode | string | Optional |
dense_query | number[] | Required |
Fields in dense_query
| Field | Type | Required |
|---|---|---|
dense_query | number | Optional |
| Field | Type | Required |
|---|---|---|
filter | object | Optional |
filter_expr | object | Optional |
k | integer | Required |
require_complete | boolean | Optional |
rrf_k | integer | Optional |
sparse_dim | integer | Required |
sparse_query_indices | integer[] | Required |
Fields in sparse_query_indices
| Field | Type | Required |
|---|---|---|
sparse_query_indices | integer | Optional |
| Field | Type | Required |
|---|---|---|
sparse_query_values | number[] | Required |
Fields in sparse_query_values
| Field | Type | Required |
|---|---|---|
sparse_query_values | number | Optional |
Read the result
The returned score comes from Reciprocal Rank Fusion of dense and sparse rankings. It is not a cosine score. Both representations need matching record IDs to describe the same source item.
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. |
| 408 | Reduce query work or adjust the timeout. |
| 409 | Resolve the conflict before retrying. |
| 413 | Split or reduce the request body. |
| 415 | Send the required Content-Type. |
| 422 | Correct the values or unsupported combination. |
| 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. |