Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

A worked example

Yes or no

Contoso runs a hybrid search query over a catalog that contains many model numbers. The team ran a fixed set of representative queries and found that the keyword ranking should count twice as much as the vector ranking. A developer deployed the query in the exhibit.

The account is enrolled in both the full-text search feature and the vector search capability. The container has a full-text index on /searchText and a vector policy and vector index on /embedding.

SELECT TOP 10 c.id, c.name FROM c ORDER BY RANK RRF( FullTextScore(c.searchText, @term1, @term2), VectorDistance(c.embedding, @queryVector), [2, 1])

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

StatementYesNo
As written, the query gives the keyword ranking twice the weight of the vector ranking.

Weights match the scoring functions by their position in the argument list. FullTextScore is listed first, so it receives the weight 2, and VectorDistance receives 1.

Correct
If a developer moves VectorDistance ahead of FullTextScore and leaves [2, 1] unchanged, the query returns an error.

Swapping the functions without moving the weights inverts the bias toward the vector ranking. The query still runs and still returns plausible results, which is why the mistake is easy to miss.

Correct
Because BM25 scores are unbounded, the vector function needs a larger weight to stop the keyword scores from dominating the fused ranking.

RRF combines the positions of items in each ranking, not their raw scores. No normalization is needed, and neither component dominates because of the size of its scores. Weights are for a measured bias, not for scale correction.

Correct
Why

The weights array in RRF is matched to the scoring functions by position, not by function name. In this query, FullTextScore comes first and gets weight 2. Reordering the functions without moving the weights silently flips the bias, and the query still runs. RRF fuses rank positions instead of adding raw scores. The different scales of BM25 and vector distance therefore do not distort the fused order, and weights are not needed to fix scale.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free