Merging Hybrid Search Results
In this article
- Merge a lexical result list and a vector result list into one candidate set by chunk id, and record which search found each chunk.
- Explain with numbers why adding raw BM25 scores to cosine similarities lets one search drown out the other.
- Predict how min-max normalization changes when a list's best or worst hit changes.
- Say what hybrid search costs and why the depth of each list is a setting you choose.
- Terms defined here: candidate set, score normalization.
Overview
A customer asks a support chatbot that answers from your help pages: "My BL-R7 shows E-42 and drops every evening". Half of that is an exact error code, half is a complaint in everyday words. A search that matches words finds the code; a search that matches meaning finds the complaint. You want both halves among the few passages the chatbot is given, so you run both searches. Now you hold two ranked lists with two kinds of score, and the obvious move, adding the scores up, quietly throws one half of the question away.
After this you can merge two result lists into one set of candidates, show with numbers why their raw scores cannot be added, predict when a rescaled score will flip, and say what running two searches costs.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Two indexes, one set of ids
- Two lists for one question
- Building the candidate set
- Why raw scores cannot be added
- Rescaling each list
- How deep each list goes
- Common mistakes
- In production
- Sources
- Check yourself, 13 questions