1 Commits

Author SHA1 Message Date
Steve Lau
6b0c477ff8 refactor: give more weight to commands 2025-12-16 16:49:13 +08:00

View File

@@ -281,6 +281,17 @@ async fn query_coco_fusion_multi_query_sources(
}
}
/*
* Temporary patch
*
* Extensions should have a higher weight than query results.
*/
for (query_source, hits) in all_hits_grouped_by_query_source.iter_mut() {
if query_source.r#type == LOCAL_QUERY_SOURCE_TYPE && query_source.id == "extensions" {
hits.iter_mut().for_each(|hit| hit.score = hit.score * 1.5);
}
}
/*
* Sort hits within each source by score (descending) in case data sources
* do not sort them