From 5a2be87f658d01bc5b3b7ecdba92ac69bf09dcf7 Mon Sep 17 00:00:00 2001
From: ai_xiaopei <xiaopei@aisim.cn>
Date: Thu, 03 Sep 2026 15:15:37 +0800
Subject: [PATCH] fix(search): 搜索准确性四连修——FTS5 MATCH 引号包裹(连字符不再被解析成 MINUS);KeywordSearch 截断按命中关键词数排序(高频 bigram 不再挤出强相关文档);原词奖励档(完整短语压过泛化 bigram);tags 字段真实参与评分(此前误用 Section)

---
 internal/search/scorer.go |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/internal/search/scorer.go b/internal/search/scorer.go
index 03c2e17..a3b4e3f 100644
--- a/internal/search/scorer.go
+++ b/internal/search/scorer.go
@@ -47,6 +47,7 @@
 	ScoreNormal  ScoreType = iota // 普通词
 	ScoreExpanded                 // 扩展词
 	ScoreSymptom                  // 症状词
+	ScoreOriginal                 // 用户原词(完整短语,强信号,高于 bigram 扩展档)
 )
 
 // ScoreTable 评分表
@@ -57,6 +58,12 @@
 		"tag":     2,
 		"content": 1,
 	},
+	ScoreOriginal: {
+		"path":    60,
+		"title":   60,
+		"tag":     60,
+		"content": 60,
+	},
 	ScoreExpanded: {
 		"path":    40,
 		"title":   30,

--
Gitblit v1.10.0