mattyork / fuzzy

Filters a list based on a fuzzy string search
MIT License
831 stars 86 forks source link

Reverse Search #9

Closed andrewlphilpott closed 9 years ago

andrewlphilpott commented 9 years ago

I'm not even sure what to actually call this and I think it's more of a feature request than an issue. Is there any way currently to do a search for something like "Bill Smith" and have it return content that's formatted as "Smith, Bill"?

jeancroy commented 9 years ago

@andrewlphilpott for that particular case, you can probably transform the input like that [First] [Last] -> [Last], [First] [Last] before search and re-transform back before display.

In the general case, to do I'll call it free word order, you need to treat Bill Smith as two different search, and somehow put score of each word together.

I have not found any library that solve that problem and do highlight so I've spent last month writing one. (Shameless plug time) Maybe you can evaluate if it fit your needs ? You can see a demo or the project page with some explanation.

andrewlphilpott commented 9 years ago

Awesome. Thanks for the follow up, Jean. I basically ended up doing something like what you suggested which worked well.