Repository navigation
search(value) {
if (value.length > 1) {
const options = {
shouldSort: true,
keys: keys,
useExtendedSearch: true,
threshold: 0,
findAllMatches: true
}
const fuse = new Fuse(listData, options);
this.items = fuse.search("'" + value).map(elem => elem.item);
} else {
this.items = listData;
}For a string ABCD FINANCE LIMITED it searches perfectly when ABCD is typed but for ABCD F or ABCD FINANCE LIMITED it doesnt show in the result. |
Answered by
krisk
Apr 3, 2026
Replies: 2 comments
|
Late reply, sorry. The include-match operator ( A few things to check:
Something like: const query = value.split(/\s+/).map(term => "'" + term).join(" ")
this.items = fuse.search(query).map(elem => elem.item) |
0 replies
Answer selected by
krisk
|
The |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Late reply, sorry.
The include-match operator (
') does exact substring matching, so'ABCD Flooks for the literal substring "ABCD F" in the field values. Combined withthreshold: 0(perfect match only), this is very strict.A few things to check:
"ABCD FINANCE LIMITED"as-is (no extra whitespace, non-breaking spaces, etc.).'ABCD 'FINANCEwill match items containing both substrings.Something like: