-
Notifications
You must be signed in to change notification settings - Fork 332
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
feat: Issue #2369 Regarding Fuzzy Search #2437
base: main
Are you sure you want to change the base?
Conversation
Added test cases for using exact (instead of fuzzy search)
Edited the interface to allow exactsearch
Added a function for searching with exact terms of top of the fuzzysearch
Why did you close the PR @wel013? It looks good at the first sight, just need to get some time to go through it thorougly. |
Hi, I believe I closed this possibly due to an accidental mistake on my end, sorry about it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @wel013!
Looks like you didn't generate types via make generate
. Also please add a demo video of the new feature in action.
/**Whether the search will be exact or fuzzy */ | ||
exactSearch?: B |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/**Whether the search will be exact or fuzzy */ | |
exactSearch?: B | |
/** Whether the dropdown search will be exact or fuzzy. Defaults to True. */ | |
fuzzy_search?: B |
// parts / utils.ts | ||
export const exactsearch = (searchTerm: string, itemText: string): boolean => { | ||
|
||
// Convert both strings to lowercase for case-insensitive comparison | ||
return itemText.toLowerCase() === searchTerm.toLowerCase(); // Exact match | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for a separate function since it's so simple, can be inlined.
? exactsearch(i.text, newVal) // Assuming exactsearch is a function for exact matching | ||
: fuzzysearch(i.text, newVal), // Assuming fuzzysearch is a function for fuzzy matching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for extra comments.
? exactsearch(i.text, newVal) // Assuming exactsearch is a function for exact matching | |
: fuzzysearch(i.text, newVal), // Assuming fuzzysearch is a function for fuzzy matching | |
? exactsearch(i.text, newVal) | |
: fuzzysearch(i.text, newVal), |
The PR fulfills these requirements: (check all the apply)
main
branch.feat: Add a button #xxx
, where "xxx" is the issue number).Closes #xxx
, where "xxx" is the issue number.ui
folder, unit tests (make test
) still pass.This is regarding the issue of someone suggested to be able to "toggle" the fuzzy search for dropdowns and allow for exact search. The main change was one more boolean attribute for the interface in dropdown.