Database endpoints
Explain a vector search
Run a vector search and inspect the search settings used for its results.
POST /v1/tenants/{tenant}/vector/{table}/topk_explain
- Supply the query and settingsChoose dimension, metric, filters and execution options.
- Run the explained searchRetrieve ranked hits with their configuration.
- Compare config with expectationsInvestigate unexpected rankings using the actual settings.
Before you start
Use your database bearer token.
Store dense vectors in the collection before searching it. The example uses demo_vectors; scores depend on your data and distance metric.
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
- Same body as the vector top-k search.
- query must be finite numbers of length dim.
- metric: cosine|dot|l2|manhattan.
- filter: equality map {field: value} (explicit null is 400).
- filter_expr: typed filter expression;
- not combinable with a non-empty filter.
- require_complete=true turns an underfilled filtered answer into 422.
- mode: fast | high_recall (default).
- engine: hnsw | bruteforce (internal tuning knob).
- index: hnsw (default) | ivf | ivf_pq.
- nprobe: 1..256 cells for ivf/ivf_pq.
- refine_k_factor: ivf_pq exact re-rank over-fetch factor.
| Field | Type | Required |
|---|---|---|
dim | integer | Required |
embedder | string | Optional |
filter | object | Optional |
filter_expr | object | Optional |
index | string | Optional |
k | integer | Required |
metric | string | Optional |
mode | string | Optional |
nprobe | integer | Optional |
query | number[] | Required |
Fields in query
| Field | Type | Required |
|---|---|---|
query | number | Optional |
| Field | Type | Required |
|---|---|---|
refine_k_factor | integer | Optional |
require_complete | boolean | Optional |
Read the result
hits is the ranked result and config shows the search configuration used. Use it to check dimensions, metric and execution choices when investigating unexpected rankings.
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. |