🐛 修复搜索关键词不能带有数字

This commit is contained in:
柚子
2025-03-07 18:44:01 +08:00
parent 93b45ffa29
commit 2831903560

View File

@@ -10,6 +10,11 @@ pub fn match_text(text: &str, query: &str) -> bool {
return true; return true;
} }
// 如果查询包含数字,则只进行原文匹配
if query.chars().any(|c| c.is_numeric()) {
return false;
}
// 获取文本的拼音并转换为小写 // 获取文本的拼音并转换为小写
let text_pinyin: String = text let text_pinyin: String = text
.to_pinyin() .to_pinyin()