Reduce threshold for fuzzy search

This commit is contained in:
Jonathan Staab 2023-06-13 09:18:57 -07:00
parent d65aa309db
commit 9f4c8becd6
2 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,7 @@
- [x] Add support for parsing and displaying lnurl invoices
- [x] Add advanced search to feeds with a summary of the filter applied
- [x] Improve url parsing
- [x] Reduce threshold for fuzzy search
# 0.2.30

View File

@ -237,10 +237,13 @@ export const searchPeople = watch("people", t => {
$or: [{"kind0.name": {$type: "string"}}, {"kind0.display_name": {$type: "string"}}],
})
return fuzzy(people, {keys: ["kind0.name", "kind0.display_name", "kind0.about", "pubkey"]})
return fuzzy(people, {
keys: ["kind0.name", "kind0.display_name", "kind0.about", "pubkey"],
threshold: 0.3,
})
})
export const searchTopics = watch("topics", t => fuzzy(t.all(), {keys: ["name"]}))
export const searchTopics = watch("topics", t => fuzzy(t.all(), {keys: ["name"], threshold: 0.2}))
export const searchRelays = watch("relays", t =>
fuzzy(t.all(), {keys: ["name", "description", "url"]})