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; }