Text contains constraint, search look alike

I’m trying to do a search system. After hours of searching on the forum, apparently there is no solution…

Basically, there is a text input where the user can type in, and the results (a repeating group) do a “search for” with the constraints “name (text field) contains input’s value”
However, I understood the contains doesn’t work in this case because it looks for a list.

So, how do you search for a similar text, if I type “ca”, I want the result to be “Good Car”

Do you guys have an alternative solution ? plug ins ?

Thanks !

1 Like

Yes there are a lot of posts on the topic you discussed.

Search for “fuzzy search” or “app wide search” or any other variety of keywords the contain search and you will find topics discussing how to do it.

Here is link to “fuzzy search” it was the second result in the search results when I searched the forum using the keyword SEARCH

There are 103 posts on this thread currently. I read each a couple of times when trying to figure out how to get it to work properly

I’m not looking for a complex fuzzy search, with auto-correcting.

It’s just : if you type characters that are contained in a text, you should have the results.
It’s a basic constraint, I don’t understand why it seems so complicated.

I will look for those terms

Sorry I read this and assumed that is exactly what the fuzzy search plugin does and the auto-correcting is like the cherry on top that makes it that much better…but I’m pretty sure there isn’t any auto correction functionality of the fuzzy search, just that it ignores capitalization.

What are you doing to update the your repeating group data source after you have typed the text into the input?

As you can see I’m just doing a “search for” with multiples constraint. But the “name contains” doesn’t show any results if you type a letter.

I tried it without any other constraints, and I’ve set the contraint manually on a database’s view, none of them works.

With what I’ve read on the forum, it’s normal because, Bubble considers the field as list not a string. The “contains” is for list not text.

I can’t say for sure that isn’t the case, but I think there is a way to convert a text to a list

Press the “more” after the dynamic expression in orange and scroll the options to see if something like “convert to list” is available…I remember it from many months ago, but don’t use it personally

Nope nothing

I don’t get why there is no similar request on the forum as well, it’s really strange

I was just playing around with this and you are right. The logical thought of the contains function is that you could set letters, but it doesn’t work.

What would be a good feature request is if they could add a function to the equals function to set the level of accuracy or up to a certain number of letters needed to return some results.

Might be something to request. I think in the meantime, if you haven’t, you should check out the fuzzy search, because it does exactly what you are looking for.

I believe you are wanting to be able to retrieve search results like this:

By typing in only a few letters I got a bunch of results that “contain” app

Alright, I’ll follow your piece of advice in the meantime.
Thank you for your help.

If anyone know has a native solution, feel free to share it.

Not at the office right now, but I did manage to find a native way to search by letter. I can even set the minimum letter count to type before result appears.

I will try to find some time to make a demo 2day or tomorrow

Here’s a link that demonstrate a workaround. It does not involve any plugin, but unfortunately depends on the “Advanced…” constraint (so maybe not the best solution for huge databases).

Editor: https://bubble.io/page?type=page&name=search&id=tempjulien&tab=tabs-1
Preview: https://tempjulien.bubbleapps.io/version-test/search


I don’t know how much worse it would be than the fuzzy search plugin in that regard. I have a database with 1700 entries and the fuzzy search plugin fails to load any results for it until after maybe 3 minutes. With that being said I am going to use your example to test the differences between its performance and that of the fuzzy pluign on that particular set of data.

Thanks for sharing. Always great to get other perspectives.

1 Like

@julienallard1 @BudSpaces

I tested both the auto-complete fuzzy search plugin vs the method Julien had shared.

Below are some screen shots from the debugger console showing different errors / alerts

The first are the errors reported when using the autocorrect plugin. The second is what I got using the method outlined by Julien.

This first one with auto-complete plugin on the page actually occurs even when I haven’t started a search…

This second one is from the method outlined by Julien when a search is performed.

Seems to me like Juliens’ method is clearly a winner in this situation. It seems like simply having the auto complete on the page it is causing performance issues. What I assume is that it is performing searches even before it is prompted to do so in order to populate the plugin with the data needed to “parse”.

I am doing this on a list of approximately 1700 items.

What is more, is after using the plugin method, which ironically produces no results even after waiting for 5 minutes, it also doesn’t load the entire list of items to be used in the “parse” as fast as a simple repeating group with a basic “do a search for” in the datasource.

I’m not sure exactly why this is, but I was attempting to use the autocomplete on this data type and had experienced the problems and was close to giving up on the possibility of giving my users the type of user experience I desired.

Now, thanks to Julien, I have a way to add the functionality to the app in way that actually works.

By the way, when using Juliens method, it took about 3 seconds for the repeating group to get results that match the inputs value, and it returned all that “contain” the text value in the search input.

Thanks Julien!


This topic was automatically closed after 70 days. New replies are no longer allowed.