Filtering versus Search for

So I am sending data to pages and am wondering if from a speed standpoint it is better to filter the page data then to do a search for in the database as a whole with constraints? Especially as the number of items in the database grows.

For example

Page one which is a project has a list of tools. Each tool has a parent project as a type as well.

Is it better to filter tools with a constraint using the loaded data on the page then to do a search for tools when displaying in a repeating group with the constraint of patent project? Does this make sense?

It is always better to have as many constraints as possible in the search, the filter is more of a 2nd solution if there is a constraint you cannot express within our current search engine.

Ok and is it possible to set a search so it just searches the data within the page you have loaded? For example instead of searching all the tools in the database it just searches the tools that have been loaded onto a specific page?

My page “project” each has a list of tools. I just want the search for function to search that list only. Is that possible or is it so simple I missed it somewhere;)

We don’t have this concept in Bubble, no. But if there are in a list on the page you can use filter then, since it’s not a search.

Ok thanks for the help today Emmanuel!!

So, will filter work only the results visible on the page?

As per the solution for comparing list with a list as given on this page one needs to filter only to achieve desired result.

Would that solution not work if this is the behaviour? Also, is the solution mentioned on that page the only way to do it? Ideally I wanted a way to do it in search but couldn’t find a way.

Thanks,
Mukesh

Since I’m guilty of that post you linked, I better chime in. The way I was doing the search on that link is no bueno. Slow, loads everything on states, various searches. There are better ways; I’ve learned this past week.

Share your database structure and I will see if I can help.

Thanks Rico for chiming in. I gave your link example as the best solution I had found so far for the thing that I wanted to do. I only wanted to check if that was the best, as I could see why it was not optimal.

So, here’s simplified version of my DB structure and what I wanted to do.
db-structure

First two conditions of query can be handled in “search for constraints”. But the third one is not possible, and hence I had to resort to your suggested solution of putting “:filter advanced” in the RG’s Data source.

But as I understand, this “:filter advanced” works on client side and not server side. So, basically I get lot of results from server to the page, and then filter them here which I could have done at server side itself which would have been faster as filtering would happen only once, and also less data needs to be transferred.

Also, I got confused with Emmanuel’s comment above and felt like he was implying that filter works only on the visible results. If that is the case, then the solution we were discussing in not just sub-optimal, but incorrect too. But not sure if I interpreted Emmanuel’s comment correctly. That’s why I had asked the question to him.

I’ve recorded a video trying to explain how I’ve set mine up. See if this helps you. If not, I can share something more structured.

1 Like

Hi Rico,

Thanks again.

There is a difference in my requirement which probably I missed to highlight.

In my case Partner can have multiple skills.

So, say partner has skills a, f, g, m out of all the skills from a to z.

Now when in the multi select dropdown a user selects skills “f, g”, then I want the query to be

“a, f, g, m” contains all of “f, g”.

In your case source is just one field, even though user can select multiple options in the multi select dropdown.
So basically your one side of the equation is just one value and other side is a list. In that case it is easy.
But if both sides are lists, then solution is what you had mentioned in your previous video that I had linked.

Thanks,
Mukesh

Great video @rico.trevisan I’ll do a bit of digging for that List Shifter you’re referring to