Add fuzzy search (approximate string matching) to the combo box and filter widgets - Mendix Forum

Add fuzzy search (approximate string matching) to the combo box and filter widgets

22

Imagine you're trying to use an app. You have to select a user from a list, but you don't remember how to spell their name exactly... Was it Aline? Alina? Aline? Eline? To find the correct person, you'll have to try each of these until you find the correct one.

 

Wouldn't it be a lot easier if you entered Aline, and all close options popped up? Even though none of the other options are exactly the same as your search term, they're still found. This is what fuzzy search is - it allows you to find terms close to your search term.

 

Many platforms already support fuzzy search, so users often expect it of an application. Even the Mendix website supports fuzzy search in its search function:

 

image.png

 

That's why I would love to see fuzzy search in the combo box and filter widgets as a toggleable option in Mendix Studio Pro. This would allow us to give the users the experience they are used to, while retaining exact control over what our applications do.

 

 

asked
3 answers

Quite an interesting idea

Created

I've had a similar requirement in the past and documented -a generic version of- the solution on my blog: https://stephanbruijnis.dev/docs/how-to/build-your-own-fuzzy-string-search/

This works with the PostgreSQL extension fuzzystrmatch but you could use pg_trim as well. Feel free to reach out if you need help / information around this.

Note that the marketplace/docs search probably uses something like GlobalSearch/Lucene search (see marketplace module) which works better when there are large sections of text, when searching for shorter strings fuzzystrmatch or pg_trim tend to work better

 

I know that the fellas at BlueTale did something similar and build a custom widget around it that allows the usage on data grids.

 

Which illustrates imho the need for such a feature in Mendix! 🚀

Created

I had this same requirement pop up recently! +1

Created