🐛 修复搜索关键词不能带有数字
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user