New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom search function property to DataSet #93
base: master
Are you sure you want to change the base?
Conversation
1c1c37d
to
1b8c3bb
Compare
This could be the most basic implementation for a fuzzy search inside an object with nested inside an email adress using fuse:
This would return all matches that have a fuzzy match score < 0.3, this can be tweaked to make it less or more fuzzy, you can also add keys like phone by adding
Look at fuse documentation for more info or use whatever filtering function you'd like. |
@pieterjandebruyne thanks for the PR, but we have the |
Hi @kouts I first used the search-as but I was not able to get the results I wanted.. If you want to use a libary for fuzzy search you need to be able to provide it with the whole dataset and options for filtering. Searching inside an object could be done with search-as, that's true. Would be nice to see this merged so I can update from this package, otherwise I will probably fork it for my use-case. |
Thanks @pieterjandebruyne, I'll find some time to create a demo using |
Not sure if compatibility with |
@kouts reading through the code I also noticed the You would probably gain a lot of sorting performance when you split the watchers into sorting change / searching change when the data changes you can probably keep the current logic. Especially if you integrate more advanced searching techniques, like fuzzy searches in this example, it would be great to gain some improved performance on large datasets you want to search/sort. |
This change will allow for a custom search function to be passed to Dataset.
If none is passed, things will work as they do now because of the default function.
Usecase for me:
- I want to be able to search objects rather then only strings
- I want some small tolerance fuzzy search
How to use:
note:
When passing custom search fc
dsSearchAs
&dsSearchIn
are no longer used since you have to add that logic in your custom search fc now.