You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here frequent@host.tld has a higher weight because this email address is used more frequently than frequent@not.tld. If the user now searched for "frequent", the entry with the higher weight should appear above the entry with the lower weight.
Since the keys are the same, this is a weighted search on a value basis, rather than on a key basis. How would we achieve this with Fuse?
The text was updated successfully, but these errors were encountered:
Looks like you’re looking for value-based boosting at query time. Since this isn’t supported out-of-the box (and I don’t have plans to include it), you could work around the issue by:
Do the standard search
Once you have all your results, for every returned item:
Get the weight for that value
Update the score to take into account the weight.
i.e., you could do score = score * ((1 - weight) || 1)
Resort the list based on the new score
(Note: make sure you set includeMatches to true, that way if you have multiple matched entries per item, you’ll know exactly which key/value was matched)
We're looking to use Fuse to implement an email autocomplete component. A typical input might look like this:
Here
frequent@host.tld
has a higher weight because this email address is used more frequently thanfrequent@not.tld
. If the user now searched for "frequent", the entry with the higher weight should appear above the entry with the lower weight.Since the keys are the same, this is a weighted search on a value basis, rather than on a key basis. How would we achieve this with Fuse?
The text was updated successfully, but these errors were encountered: