Advanced search on server side

So I have a “Article” data type with 10’s of thousands of records in it and each record contains a lot of information. A field in the table is a list of keywords (i.e. technology, health, education, etc) which is what the article is generally about. The user has a list of keywords that they subscribe to which is also a list of texts. Let’s say a user has health and education as their subscribed keywords.

I need to display in an RG a list of articles that only have keywords that the user has subscribed to. So if an article is tagged as health this would show up in the RG. If the article is tagged as technology, health and education, this article would also show up in the RG as both lists have overlapping values.

This is my current setup (ignore the fact it says “Parent and child keywords”, just assume it just says “keywords”
The above setup works. The problem is that advanced filters happen client side and give my data table is so large, I’m afraid this is going to consume way too much memory and crash the app.

Bubble does not provide a “contains list” option:
The “contains” option only works for a single item on the right side of the “contains” constraint

I really need this entire search to happen server side. Does anyone have any clever workarounds for this?

I’m sorry to be the bearer of bad news but… database structure :flushed:

You need a Tag datatype with fields Article (datatype Article) and Category (in a perfect world this would also be a Category datatype, so many Tags all share the same “health” category, but at the bare minimum it can be a regular text field)

Then you can simply do Search for Tags where Category is in Current User's Keywords, then after the search do:each item's Article


Thanks for your help here tyler.

Are you saying the Category field is a list? If it’s not a list, then an article with three tags would show up three times in the returned results from the search you described.

Category is a single item field. And Bubble can’t return duplicate Things so it would only show up once :blush: Worst case you slap a :unique elements after it but that won’t be needed

OOOOOHHHHH clever. Thanks so much

1 Like

I’m trying to think if there’s any other way to slice your current structure but I’m not too sure…

I think your solution works. I’m going to implement now and report back.

1 Like

Works great!. Thanks again tyler

1 Like