From 6b0c477ff896db76f812638ef536998385eb6f2e Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Tue, 16 Dec 2025 16:49:13 +0800 Subject: [PATCH] refactor: give more weight to commands --- src-tauri/src/search/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src-tauri/src/search/mod.rs b/src-tauri/src/search/mod.rs index edfcb0f7..1e5ce6b2 100644 --- a/src-tauri/src/search/mod.rs +++ b/src-tauri/src/search/mod.rs @@ -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