From 1b09d3707ab5b411e4322ee7f1124a58da7d10a7 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Wed, 14 Jan 2026 20:56:38 +0100 Subject: [PATCH] modified scoring --- glance-system/glance-kisfenyo.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/glance-system/glance-kisfenyo.yaml b/glance-system/glance-kisfenyo.yaml index 11365d4..d75d55a 100644 --- a/glance-system/glance-kisfenyo.yaml +++ b/glance-system/glance-kisfenyo.yaml @@ -171,13 +171,16 @@ data: function score(item, q) { const t = normalize(item.title); - const u = normalize(item.url); if (!q) return 0; - // simple scoring: prefix > includes, title > url - if (t.startsWith(q)) return 100; + if (t === q) return 200; + if (t.startsWith(q)) return 120; + + // boost if query matches start of any word + const words = t.split(' '); + if (words.some(w => w.startsWith(q))) return 95; + if (t.includes(q)) return 70; - if (u.includes(q)) return 40; return -1; }