fix fts prefix ~

This commit is contained in:
polv committed 2026-03-16 12:44:12 +07:00
1 parent f0cafa450d
commit 79deaf9372
3 files changed
+7 -9

No files matched your search

+6 -7
View File
@@ -153,9 +153,12 @@ function SearchPage() {
});
if (isNew) {
if (!result.length && !isFromSplit && /^[^ ]{3,} $/.test(q)) {
const [s1, prefix = "", s2 = ""] = q.split(/^([\*\?\[\]\~]*)/);
const text = s1 || s2;
if (!result.length && !isFromSplit && /^[^ ]{3,} $/.test(text)) {
const segs = await invoke<{ surface: string }[]>("tokenize", {
text: q,
text,
});
if (segs.length > 1) {
const newQ =
@@ -164,7 +167,7 @@ function SearchPage() {
segs.map((s) => s.surface).join("") +
" ";
searchParams_setQ(newQ);
searchParams_setQ(prefix + newQ);
return;
}
}
@@ -199,10 +202,6 @@ function SearchPage() {
set_isScrollEnd(true);
return;
}
setTimeout(() => {
target.scrollTop = scrollTop + 100;
}, 100);
};
function onSearchboxChange(q: string) {