#community-help

Understanding Rank Fusion Score in Typesense's Multi-Search

TLDR Ayush had queries about comparing rank_fusion_score across collections in Typesense's hybrid search. They were explained and clarified by Kishore Nallan on how the score works and how it could be manipulated for their use-case.

Powered by Struct AI
6
1mo
Solved
Join the chat
Aug 28, 2023 (1 month ago)
Ayush
Photo of md5-b599fe398728a1867404c6c8ef6e98de
Ayush
12:34 PM
Hei there - We're currently implementing multi-search with hybrid/semantic search using Typesense. I have a question regarding the rank_fusion_score in different collections. Can these scores be compared across various collections?

Further is there a recommend or existing way to combine across collections ( mostly by with shared properties) then rank them using either rank_fusion_score or vector distance ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
03:47 PM
Rank fusion score combines positional information between semantic and keyword search. So technically you can compare them across two searches in two collections.
03:47
Kishore Nallan
03:47 PM
I don't follow your second question
Ayush
Photo of md5-b599fe398728a1867404c6c8ef6e98de
Ayush
08:26 PM
Thanks Kishore Nallan you for your initial response.

To provide further clarity on the second question, let's consider two collections: Collection A and its sub-collection, Collection B.

Our objective is to establish a ranking system utilizing the rank_fusion_score.
In essence, we aim to rank a document in Collection A based on both its inherent rank_fusion_score and the cumulative rank_fusion_score of all the document hits present in Collection B that are linked to the corresponding document in Collection A.

The question arises: Should we simply aggregate the rank_fusion_score values from the hits in Collection B that are associated with the specific document in Collection A? Or is there a distinct approach for merging and subsequently ranking these scores?
Aug 29, 2023 (1 month ago)
Ayush
Photo of md5-b599fe398728a1867404c6c8ef6e98de
Ayush
11:55 AM
Extending on the first question the rank_fusion_score are based on the semantic and keyword ranks [Source]? How are they calculated are they just the indexes in the corresponding search hits ?

Or are ranks and scores used interchangeably?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
12:24 PM
Rank fusion score is computed purely on the position of a hit within the results in semantic and keyword search hits. Higher the hit on the list, the higher the score. We assign 70% weight for keyword search and 30% weight-age for semantic search. So you should be able to compare/combine scores across collections along with your own weights for each collection.