fuzzysort
fuzzysort copied to clipboard
Search query to match multiple properties?
Hi,
Thanks for a great library. I have an array with some objects, they are like:
var myArr = [{title: "Audi Q3", position: "Stockholm"}, {title: "Volkswagen e-tron", position: "Berlin"}]
and then a query like this: var myQuery = "audi stockholm"
but then I get no matching results at all? If the query only contains "audi" or "stockholm" then I get the hits, but not when combined...?
oops. i recently added the ability to search with spaces. and i don't use keys
, so i forgot to make sure they work well together.
the keys are each searched separately, neither match your search so you get no results.
i'm not sure how this should work.
but the workaround is split your search into multiple searches and combine the results, or simply merge your keys into 1 combined string and don't use the keys
feature.
Okay, got it, thank's for letting me know!
[...] or simply merge your keys into 1 combined string and don't use the keys feature.
Hi
I did this by merging my users collection
Ex : {firstname: 'Martial', lastname: 'SERON', username:'mseron'}
=> 'Martial|SERON|mseron'
When I type 'marser' it finds the user, but there is no result with 'sermar'. How can I make it work ?
sermar
shouldn't match. ser mar
should match. this issue is about searches that contain spaces.