-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Not sure what the best title for this issue is, but here's what I'm trying to do:
I've got a halogen-nselect component with client-side filtering and use this package to highlight search matches in the dropdown items.
I've got an item type with string fields for names & descriptions. I'm using the Fuzzy a type and the match function to search & filter the items. I sort the items by their match distance.
I have some test data with the name Ask my Accountant & description Some long descriptive text about the account..
When I search something like Ask descriptive, the Ask my Accountant item is 3rd in the list & the highlighting for the description is messed up because it tries to match "ask" instead of realizing there's a full match for "descriptive".

What I expected was at least Ask & descriptive both being matched.
I also needed to remove my filtering(I was doingfuzzyMatch.ratio >= 5 % 6, now I do fuzzyMatch.ratio > 0 % 1) because the missed matches were causing the accounts to drop off my list.
Is there a better way for me to tackle this or does it require changes to the library? I was thinking of maybe splitting the search string into a list of words, running match on each word, & figuring out some way of merging all the Fuzzy a or FuzzyStrresults.