dart-fuzzywuzzy icon indicating copy to clipboard operation
dart-fuzzywuzzy copied to clipboard

Search multiple properites in object

Open wfuener opened this issue 4 years ago • 4 comments

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.

wfuener avatar May 13 '21 19:05 wfuener

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?

SphericalKat avatar May 13 '21 20:05 SphericalKat

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?

wfuener avatar May 13 '21 21:05 wfuener

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.

cmenkemeller avatar Jan 02 '23 21:01 cmenkemeller

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

Hari-07 avatar May 31 '24 14:05 Hari-07