SphericalKat / dart-fuzzywuzzy

A dart port of the popular fuzzywuzzy package
https://pub.dev/packages/fuzzywuzzy
GNU General Public License v2.0
42 stars 7 forks source link

Search multiple properites in object #4

Open wfuener opened 3 years ago

wfuener commented 3 years ago

Is it possible to specify multiple object properties in the getter? For example, I have a list of user objects and I'm looking to do a search on the username property and name property of a user object.

SphericalKat commented 3 years ago

Such a usecase would require matching on both of the fields, which leads me to a dilemma on how the scoring would occur; would the final score be the aggregate of all the getter scores? Or would one take precedence over the other?

wfuener commented 3 years ago

Yes that is a tricky. My thought process was that, each property would be scored separately and return object would then have the score for both separately. For sorting it could sort by either combined score or by highest property value per object and just ignore the small properties. Would do you think of that solution?

cmenkemeller commented 1 year ago

I'm also interested in this. Any thoughts on the proposed implementation?

For my usecase, I would propose an aggregate score, with the ability to add weights/priority to each getter.

Hari-07 commented 6 months ago

@wfuener For a simple workaround the getter could be $username-$name and then it would do what you want