-
-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixing fuzzy and exact search #408
Comments
As per #411, I'm actually working on logical query expressions, such that you can search like this: const result = fuse.search({
$and: [{ author: 'abc' }, { title: 'xyz' }]
}) const result = fuse.search({
$and: [{ author: 'abc' }, { $or: [{ title: 'nonfic' }, { title: 'html' }] }]
}) From there, you can then mix it with extended searching so you could do exact-match for color: const result = fuse.search({
$and: [
{ title: 'old war' }, // fuzzy "old war"
{ color: "'blue"} // exact match for blue
]
}) |
Hey hey, const result = fuse.search({
$and: [
'old war', // fuzzy "old war" in all keys
{ color: "'blue"} // exact match for blue
]
}) My goal is to not only search for Thanks so much! |
@jnsprnw Did you end up figuring this out? I've come up against the same need/want. |
Unfortunately not. |
Let’s say I have the following array:
The user can type a term for fuzzy searching within the title, but also a dropdown to select the exact color.
Should I filter the array by color; create a new Fuse instance with the filtered array; and then do the fuzzy search? Not sure if that’s the best thing performance-wise if I do that every time a new color is selected from the dropdown.
Having an API to add/remove items as suggested in #379 might be useful.
The text was updated successfully, but these errors were encountered: