mirror of
https://github.com/artegoser/AnoPaper.git
synced 2024-12-23 09:23:45 +03:00
fix: search scoring
This commit is contained in:
parent
2317dd6fdc
commit
e042e0bc76
1 changed files with 3 additions and 1 deletions
|
@ -22,6 +22,8 @@ function Notes() {
|
|||
let n = Object.values(localStorage.getObj("Notes"));
|
||||
|
||||
let fuse = new Fuse(n, {
|
||||
includeScore: true,
|
||||
useExtendedSearch: true,
|
||||
keys: ["name", "text", "textTime", "tags"],
|
||||
});
|
||||
|
||||
|
@ -32,7 +34,7 @@ function Notes() {
|
|||
if (search !== "") {
|
||||
found = found
|
||||
.sort((a, b) => {
|
||||
return b.refIndex - a.refIndex;
|
||||
return a.score - b.score;
|
||||
})
|
||||
.map(({ item }) => item);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue