Skip to content
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

Use fuzzy string matching for similar project name detection #1008

Open
rmunn opened this issue Aug 6, 2024 · 1 comment
Open

Use fuzzy string matching for similar project name detection #1008

rmunn opened this issue Aug 6, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request GraphQL owner: Kevin 📦 Lexbox issues related to any server side code, fw-headless included
Milestone

Comments

@rmunn
Copy link
Contributor

rmunn commented Aug 6, 2024

Describe the feature
Use fuzzy string matching for project name matching (see #979).

Who is this feature for?
When users create a new project, #979 uses simple string.Contains logic to look for projects with similar names. But Postgres has a built-in feature for fuzzy string matching using Levenshtein distance; you just have to enable the extension in your ModelBuilder configuration. We might want to improve the project-name matching by using fuzzy string matching to find similar projects.

There's even a version that makes the search efficient: you define a maximum distance, and as soon as Postgres determines that the actual distance would be larger, it stops calculating. So you can write FuzzyStringMatchLevenshteinLessEqual(needle, haystack, 5) <= 5 and get a list of similar strings without wasting too much time on dissimilar ones.

Pages affected
Project creation page

@rmunn rmunn self-assigned this Aug 6, 2024
@rmunn rmunn added enhancement New feature or request GraphQL owner: Kevin labels Aug 6, 2024
@rmunn
Copy link
Contributor Author

rmunn commented Aug 6, 2024

Implementation would be simple: just add EF.Functions.FuzzyStringMatchLevenshteinLessEqual(p.Name, input.ProjectName, 5) <= 5 to the ProjectsByNameAndOrg query.

@hahn-kev hahn-kev added this to the vNext milestone Dec 9, 2024
@hahn-kev hahn-kev added the 📦 Lexbox issues related to any server side code, fw-headless included label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request GraphQL owner: Kevin 📦 Lexbox issues related to any server side code, fw-headless included
Projects
None yet
Development

No branches or pull requests

2 participants