File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -670,6 +670,7 @@ async def __query_collection(
670670 dense_results ,
671671 sparse_results ,
672672 ** hybrid_search_config .fusion_function_parameters ,
673+ distance_strategy = self .distance_strategy
673674 )
674675 return combined_results
675676 return dense_results
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def weighted_sum_ranking(
7171 distance_strategy = kwargs .get ("distance_strategy" , DistanceStrategy .COSINE_DISTANCE )
7272 is_primary_distance = distance_strategy != DistanceStrategy .INNER_PRODUCT
7373
74- # 1. Normalize both sets of results onto a 0-1 scale
74+ # Normalize both sets of results onto a 0-1 scale
7575 normalized_primary = _normalize_scores (
7676 [dict (row ) for row in primary_search_results ],
7777 is_distance_metric = is_primary_distance
@@ -89,7 +89,7 @@ def weighted_sum_ranking(
8989 # Process primary results
9090 for item in normalized_primary :
9191 doc_id = str (list (item .values ())[0 ])
92- # Overwrite the 'distance' key with the weighted primary score
92+ # Set the 'distance' key with the weighted primary score
9393 item ["distance" ] = item ["normalized_score" ] * primary_results_weight
9494 weighted_scores [doc_id ] = item
9595
You can’t perform that action at this time.
0 commit comments