Skip to main content
VectorAI DB provides two client-side SDK utilities for combining results from multiple searches into a single ranked list. Both methods run in the client after your searches complete, not on the server.
  • Reciprocal Rank Fusion (RRF) scores each result by its rank position across all result lists. Use it when combining searches with different query vectors or embedding models where raw scores are not directly comparable.
  • Distribution-Based Score Fusion (DBSF) normalizes scores based on the statistical distribution of each result set before combining them. Use it when your searches have different score ranges or distributions.

Set up a collection

Run the following setup once before using either fusion method. It creates a collection and inserts 100 sample documents.

Reciprocal Rank Fusion

The following example runs two searches using different query vectors and fuses them with RRF. The ranking_constant_k parameter controls how much weight higher-ranked results receive. The default value of 60 provides balanced fusion for most use cases.
Each RRF result includes these fields:
  • id: The unique identifier of the matching point
  • score: Fused score based on rank positions across all result lists
  • payload: Metadata object if the original searches included payloads
The ranking_constant_k parameter affects how scores are distributed:
  • Lower values (for example, 10) give significantly more weight to top-ranked results
  • Default value (60) provides balanced weight distribution, matching Cormack et al. (SIGIR 2009)
  • Higher values (for example, 100) distribute weight more evenly across all ranks

Distribution-Based Score Fusion

The following example runs two searches with different score distributions and fuses them with DBSF. DBSF normalizes each result set before combining, producing balanced rankings when searches use different score ranges.
Each DBSF result includes these fields:
  • id: The unique identifier of the matching point
  • score: Normalized fused score based on score distributions
  • payload: Metadata object from the matching point
DBSF is particularly effective when:
  • Combining searches with different score ranges or distributions
  • One search type consistently produces higher raw scores than another
  • You need normalized scores that reflect relative relevance across search types