OriginChainDB
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

Combine dense and sparse rankingsMatching IDs connect both representations to the same source item.
  1. Prepare both query representationsSupply dense coordinates and sparse positions with values.
  2. Combine ranked candidatesUse Reciprocal Rank Fusion across the two searches.
  3. Read the fused resultInterpret its score as fusion, not cosine similarity.

Before you start

Use your database bearer token.

Connection setup

Index dense and sparse vectors under the same record IDs before combining their search results.

Path parameters

FieldTypeRequired
tenantstringRequired
tablestringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI 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.
FieldTypeRequired
candidatesintegerOptional
dense_dimintegerRequired
dense_metricstringOptional
dense_modestringOptional
dense_querynumber[]Required
Fields in dense_query
FieldTypeRequired
dense_querynumberOptional
FieldTypeRequired
filterobjectOptional
filter_exprobjectOptional
kintegerRequired
require_completebooleanOptional
rrf_kintegerOptional
sparse_dimintegerRequired
sparse_query_indicesinteger[]Required
Fields in sparse_query_indices
FieldTypeRequired
sparse_query_indicesintegerOptional
FieldTypeRequired
sparse_query_valuesnumber[]Required
Fields in sparse_query_values
FieldTypeRequired
sparse_query_valuesnumberOptional

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
StatusWhat to do
200OK
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
408Reduce query work or adjust the timeout.
409Resolve the conflict before retrying.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
499The client cancelled the request.
500Check the outcome before retrying a write.
501Check deployment support for this operation.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd