-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Is your feature request related to a problem? Please describe.
I've been looking for a replacement to fuse.js and came across this library. I use fzf all over my OS and like the speed and results it produces. This nearly replaces all of the features I currently use on fuse.js except for one key aspect. The ability to have weighted search across multiple item properties. You can see a fusejs example here. I think right now my only option is to use the non-string selector feature by concatenating the properties. That can get messy though if all of the properties are not simple terms/words... and I'm not sure how that would affect scoring.
An example usage could be searching calendar events that include an event title, name of the host, names of all the participants, and a short description.
{
title: 'Learn how to fzf!',
host: 'Ajit',
participants: ['Craig', 'John', 'Bill'],
description: 'How to use fzf on your OS, in vim, and now in JS!',
}
Describe the solution you'd like
A possible solution without weighting the item properties might be to search and score each searchable property. And then calculate a single score for the item. Some simple (configurable) item scoring calculates could be total score, average score, or highest score. And then if anyone wanted to hook into the scoring algorithm they could implement a weighted scoring algo.
Describe alternatives you've considered
After searching for fusejs alternatives, fzf is the one I chose to dive into first so I haven't looked hard at other fuzzy search/sort libraries. And the only alternative within fzf that I've found is the concatenating properties in the selector.