Skip to content

Matching Based on Arbitrary Word Order #3

@prikhi

Description

@prikhi

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".
2019-04-22-074612_6170x1680_scrot
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.

Here's my matching code

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions