From 51258a84f48d88549a8dff90b12ca90b9dfe2532 Mon Sep 17 00:00:00 2001 From: aecsocket Date: Mon, 20 Apr 2026 16:19:39 +0100 Subject: [PATCH 1/2] re-enable summary weighting in search --- .../labrinth/src/search/backend/typesense/mod.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/apps/labrinth/src/search/backend/typesense/mod.rs b/apps/labrinth/src/search/backend/typesense/mod.rs index 67ed6d798a..3ed806ca60 100644 --- a/apps/labrinth/src/search/backend/typesense/mod.rs +++ b/apps/labrinth/src/search/backend/typesense/mod.rs @@ -109,28 +109,18 @@ impl Default for RequestConfig { } fn default_query_by() -> Vec { - // [ - // "name", - // "indexed_name", - // "slug", - // "author", - // "indexed_author", - // "summary", - // ] - ["name", "indexed_name", "slug", "author", "indexed_author"] + ["name", "indexed_name", "slug", "author", "indexed_author", "summary"] .into_iter() .map(str::to_string) .collect() } fn default_query_by_weights() -> Vec { - // vec![15, 15, 10, 3, 3, 1] - vec![15, 15, 10, 3, 3] + vec![15, 15, 10, 3, 3, 1] } fn default_prefix() -> Vec { - // vec![true, true, true, true, true, true] - vec![true, true, true, true, true] + vec![true, true, true, true, true, true] } const fn default_prioritize_exact_match() -> bool { From 52821a40d86cffc9a28a730f81de885098a7aaac Mon Sep 17 00:00:00 2001 From: aecsocket Date: Wed, 22 Apr 2026 12:36:56 +0100 Subject: [PATCH 2/2] prioritize tokens/drop tokens thresh --- .../src/search/backend/typesense/mod.rs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/apps/labrinth/src/search/backend/typesense/mod.rs b/apps/labrinth/src/search/backend/typesense/mod.rs index 3ed806ca60..f5c44b51aa 100644 --- a/apps/labrinth/src/search/backend/typesense/mod.rs +++ b/apps/labrinth/src/search/backend/typesense/mod.rs @@ -109,10 +109,17 @@ impl Default for RequestConfig { } fn default_query_by() -> Vec { - ["name", "indexed_name", "slug", "author", "indexed_author", "summary"] - .into_iter() - .map(str::to_string) - .collect() + [ + "name", + "indexed_name", + "slug", + "author", + "indexed_author", + "summary", + ] + .into_iter() + .map(str::to_string) + .collect() } fn default_query_by_weights() -> Vec { @@ -132,13 +139,13 @@ const fn default_prioritize_num_matching_fields() -> bool { } const fn default_prioritize_token_positions() -> bool { - // true - false + true + // false } const fn default_drop_tokens_threshold() -> usize { - // 0 - 1 + 0 + // 1 } const fn default_max_candidates() -> usize {