Contains Keywords matching rules

“Contains keywords” seems to be case-insensitive. If I search for “note” or “Note”, I get matches on “note” and “Note”

“Contains keywords” seems to do partial word matches but I can’t work out the rules. If I search for:
“note”, I get matches on “note” and “notes”
“not”, I don’t get any matches (some minimum number of characters?)
“notes”, both “note” and “notes” match ???
“notesi”, I don’t get any matches as you’d expect

The reference documentation I can find is very high level. Could someone tell me where I can find the exact set of word matching rules “Contains keywords” uses?

Thanks for any help you can give.

1 Like

Hi @alan5 ,

My experience has been that “contains keyword(s)” returns:

  • whole words only
  • words in any order
  • case insensitive words

“Contains” requires:

  • partial words
  • words need be in precise order
  • case sensitive words

Hope this helps :+1:t2:


Thanks for the reply.
This is getting even more odd. I did the original partial word match tests on a multiline text field. That shouldn’t make any difference but I tried them on a ordinary text field and got only whole word match. Then I tried it again on a different multiline text field and got only whole word match. So, I reran the tests on the original multiline field and still got a strange, sort-of partial word match. I checked the field definitions and the search constraints but they look the same. I noted this in my personal log rather than spending more time on this. It’s probably some kind of strange “corner” case I’ve accidentally stumbled on.

I’ll proceed as if “contains keywords” is case-insensitive and does only whole word searches.

I reported this behavior as a bug to Bubble. If it’s not just some flakiness in my app, it sufficiently obscure that it would involve a lot of hair-pulling before others understood the problem.

We must, indeed, all hang together or, most assuredly, we shall all hang separately.
- Benjamin Franklin

1 Like

Here are some tests I’ve run:

“test” has the following text “test desc note sum”
“test2” has the following text “tests description notes summary”

When I enter the following input to a constraint with Contains Keyword(s):
“test” matches test and test2
“tests” matches test and test2

“desc” matches test
“descr” matches nothing
“desciption” matches test2

“note” matches test and test2
“notes” matches test and test2

“sum” matches test
“summ” matches nothing
“summary” matches test2

1 Like

There is one addition to this. In case we are doing “Contains” on “Any Field”, then partial words doesn’t work.


I’m just looking for better user/developer documentation on the matching rules for “contains keywords”.

I’m seeing what I’ll call “interesting” results.

Does anyone know if the matching rules are documented anywhere?

Have you looked at the docs?
You can see some examples in this post

1 Like

Yes, I have. I use “contains keywords”, but wish to better understand why some matches are occurring.

unfortunately, due to its erratic behavior and bubble’s wholly incomplete documentation for “contains keywords”, I’ve had to stop using it altogether. thankfully the regular searches work as expected…

Note: if you are determined to try to understand matches, use the back end searches if you aren’t already.

it’s actually a deterministic behaviour very easy to understand once you make a couple tests, have a look at this example.
It has a specific use case and most of the apps will only need a normal search.

1 Like

contains keywords the cat is on the table

will match these value in the database (just some example):
cat table
CAT table
the cat is on the yellow table
the table is a cat
your cat is not a TABLE
I think my TaBLe is a Cat
one cat plus one cat equals a table
many cats on the table
tables cat
tables cats

but it will not match:
the cat is on the tablet
catss table
i just have one cat
the table is empty

I hope this helps :cat2::smile_cat:

There’s something I don’t understand though. Why does it match the cat is on the yellow table but not the cat is on the tablet?

1 Like

the first string contains both cat and table, the second is missing table because tablet is not table nor tables.
The words the, is, on are excluded by the search, the other words must be present in the string as whole words, plurals and cases don’t matter.

1 Like

One more update.

“Any Field Contains” works like this:

  • Doesn’t match partial words
  • Is case insensitive
  • Words can be in any order
  • Words can be in multiple fields. e.g. If you search for “month durations” as keywords and if one field contains word “month” and another field contains word “durations”, it would match.