fix/短查询命中验证修复#22
Merged
Snailclimb merged 1 commit intoSnailclimb:masterfrom Apr 7, 2026
Hidden character warning
The head ref may contain hidden characters: "fix/\u77ed\u67e5\u8be2\u547d\u4e2d\u9a8c\u8bc1\u4fee\u590d"
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
用户提问“什么是进程”等中文语句,向量检索显示成功检索到12条相关文档,但是RAG仍然返回“未检索到相关信息”
原因
hasEffectiveHit的短 token 命中确认逻辑存在两处缺陷:SHORT_TOKEN_PATTERN(^[\p{L}\p{N}_-]{2,20}$)中\p{L}包含中文字符,导致 Query 改写后的长短语(如"操作系统中进程的定义与基本概念",15字无空格)也被判定为短 token,触发字面匹配并失败。
修复
isShortTokenQuery:含 CJK 字符时长度限制收紧为 ≤6hasEffectiveHit:新增extractCoreTerm提取中文问句核心词再匹配额外修复
Redisson 4.0.0 的
readGroup在无消息时返回EmptyList而非空 Map,内部强转失败抛出
ClassCastException,导致所有 Stream 消费者持续刷错误日志。在
RedisService.streamConsumeMessages捕获该异常并静默处理。