I’m hoping there’s an experienced Bubbler who can give some guidance on best practices for many-to-many searches (or, searching a list based on a list) involving large datasets. An example would be searching for Articles using multiple Subject tags.
The method commonly discussed on the forum is to do an advanced filter and intersect with. This works, but for larger data sets it’s problematic because it’s executed client side. For a large dataset, Bubble loads thousands of entries into the browser to get enough matches to fill the repeating group. The browser then lags and can even crash.
Because of the above limitation, there are two additional methods I’m exploring:
Moving the search to a backend workflow with a “Return Data from API” action. Bubble lets you build the search constraints in the backend workflow, including using the advanced filter and “intersect with”. You then use the API connector to pass the search parameters and get the results, as though you are calling an external data source. Bubble limits results to 50 items.
Using an intersecting/joining table, where you create an entry for each Article-Subject connection. Then, in your search results RG, you set it up as:
The Articles-Subjects joining table is the data source and you use “:unique elements” to remove duplicates (since an Article may appear multiple times in results, once for each matching Subject tag).
Or you use Article as the data source. You do a nested search to look for Articles that appear in a search for Articles in the Article-Subject joining table which contain the selected Subject tags.
On a basic level I know how to set all of the above up. But I expect that as I move into implementation I will run into snags here and there.
Have any Bubblers set up the above (or another method) to do many-to-many searches server side, instead of the client side advanced filter?
And if so, can you offer any advice on the best method that combines performance, scalability and simplicity?