Forum Academy Marketplace Showcase Pricing Features

New behavior for "contains" vs "contains keyword(s)"

Hi all,

If you’ve been Bubbling for a while, you may have noticed that searches involving “contains” would not always return what you expected. There was a bit going on behind-the-scenes that made it a bit surprising to newer users, so we have rolled out changes to clarify the situation.

The old “contains” clause has now been renamed “contains keyword(s)” - any existing use of “contains” has automatically been migrated for you. This behavior has not changed, but to clarify: this search will take the phrase you supply, break it up into component words, remove any “stop” words (short, common words like “the” or “a”), and look for entries in the database that have those chunks in it. For example, searching for ‘cat hat’, ‘cat in hat’, ‘cat in the hat’, ‘the hat cat’, or ‘hat cat’ would return ‘the cat in the hat’. This does not respect partial words that are not of the same stem though, so “pepp” would not return “peppers”.

There is a new “contains” clause that has different behavior which a lot of users expect it to have. This will look for exact matches of what you supply. So, ‘cat’, ‘hat’, ‘cat in’, ‘cat in the’, ‘in the hat’, ‘at in’, or ‘cat in the hat’ would all return the phrase ‘the cat in the hat’. However, searching for ‘cat the hat’, ‘cat hat’, or ‘Cat’ would not return ‘the cat in the hat’. This does work for partial searches, so “pepp” would return “peppers”.

Documentation in the Reference has been updated accordingly. Also note that there are also “does not contain” and “does not contain word(s)” as well.

This is not a breaking change, so there’s nothing you need to do to preserve your old app behavior. If you find the new “contain” is closer to what you want, you can now use it!

Many thanks to @sweta for working on this feature, as well as @peterj!

Cheers,

Allen

29 Likes

several workflows on my site have stopped working around the exact time of this post… I’m getting a critical console errors and dialogs.

Perhaps its because of the recent URL slug update rollout thats making me overly sensitive to these ‘random’ bugs.

I’m receiving this error id
1598319007126x241382952963683300

I’m filing a report now.

1 Like

Looked into your bug report. I don’t think it has to do with this feature rollout because I don’t see a use of “contains” around where the bug occurs (plus, this feature was actually rolled out earlier in the afternoon). Will leave some notes for our engineering team as they further triage this bug.

2 Likes

Thanks for the update! Can’t wait to try the partial word match.

Any plans to bring support for partial word match to the first method?

I’m would love to have the best of both worlds of being able to “fuzzy math” search phrases while not requiring the users to finish their words.

1 Like

Thanks for the updates! :clap:

@j805 www.NoCodeMinute.com

For All Your No-Code Education Needs:

  • One-on-One Tutoring
  • eLearning Hub
  • Video Tutorials
  • No-Code Classes

This is great, thank you!

@allenyang This is aaaawesome!

@sweta So how does it work? Can I just add a comma-separated list of words?
“contains keyword(s)” Cat, Hat, the

1 Like

Just noticed this after getting a customer complaint and it has changed the behaviour of some of the app searches which required explicit “Contains” now I will have to go through the app find out what else this has broken. Yet another lets see what happens change form Bubble. Not happy!

Per the original post, we changed the name of the original “contains” operator to “contains words”, and automatically migrated all previous uses of “contains” to “contains words”. In other words, this rollout should not have changed any existing functionality, so if you see something that’s changed, that’s probably a bug - please file a bug report so we can investigate!

(The new “contains” is brand new, additional functionality)

1 Like

Trying to figure this out. There are no references in the docs for “contains keywords(s)” fyi

2 Likes

You should be able to give it a phrase with spaces in it, like a text input’s value (to create a search box of sorts)

1 Like

Well it didn’t work. I have gone through and changed them all now.

+1

@allenyang Unlike what was mentioned in original post, there is no documentation (neither old nor new) on this.

This is great. It works perfectly!

Oops, @mghatiya you’re absolutely right, I think the new Reference entries were lost in the deploy somehow. I’m adding them now…

1 Like

Sure. Thanks. Would you update when you have added? I am not able to find it even now.

It’s live now - it’s the four entries starting here: https://bubble.io/reference#Data.Messages.text.contains

2 Likes

Can we get the “contains keywords” added to the URL parameters?

Not seeing it and without it the new behavior of “contains” causes an issue for me passing ‘filters’ into the URL parameter for my search page

Screen Shot 2020-10-13 at 3.45.00 PM Screen Shot 2020-10-13 at 3.44.49 PM

Screen Shot 2020-10-13 at 3.46.48 PM Screen Shot 2020-10-13 at 3.46.42 PM

1 Like

@allenyang hi, I like this new method of searching, but I think it doen’t work when the data is written in japanese language and uers search in japanese.
Is it because japanese language doesn’t contain spaces between each word in phrase?

That may be the case, but could you please send us a bug report with an example so we can investigate? Thanks!

1 Like