Hi All,

So first of all, this is an observation as per my experience with how websites should work. I built a Search functionality using different filters and everything seems to work fine unless I went to the Chrome Inspect network logs of what is happening behind the “Search” button

I have attached a “Do a Search for” event( with constraints on different values coming from the UI ) on the search button but it seems that this doesn’t actually hit the database / doesn’t call the server. Whenever I click on search - instead it seems to be doing some client side filtering and giving me the results.

Documentation here says that this functionality hits the server but is not working accordingly.

Is this the correct behavior of the “Do a search for” function or something else needs to be configured as well ?

Chrome Network Logs when “Search” is clicked ( no calls to backend or anything ):

If the search is unchanged, it won’t be run again.

It’s not particularly clear why you’re setting states to a list of results also - you may have better results with Display list in a Repeating Group if you’re enabling click to search functionality (as opposed to updating the search as soon as they change a filter).

Searches have to be server side, because it searches the database, and it’s self-evident that that can only happen on the server.

Thanks George !

I verified the series of logs and it seems that when the app loads, it loads all the records first and even though the “Search” button has “Do a search for” attached to it, the subsequent calls are just further filter that only happen on client side.

Also to confirm, I do change the filters on the UI before hitting search but still it doesn’t hit the DB again. The results do get updated on the UI but without hitting the DB ( so only client side filtering happens )

I have not used Repeating group due to customization reasons and ideally it should not matter whatever container is used( It has not been explicitly mentioned that only Repeating Group should be used with Do a Search For , for it to work on Server side )

When your app loads, does it load an unconstrained search?

If so, Bubble wouldn’t need to hit the server again, as it already has the necessary data and its fields so can filter the remaining data client side.

Probably this might be a cause, I have not explicitly asked for any search during the page load but I still see that something is triggering it and this is probably the culprit ( I don’t know what is this “Autocomplete” , I have just used “Search and Auto Correct” for address completion via Google Places API but it should not do anything with this ( expected )

What do you think ?

If you’re using a Fuzzy search plugin, then yes, it’s all done client side, because that’s how fuzzy search works. Fuzzy search plugins require downloading all possible search results to the client, then filtering them.

In the age of WU, don’t use fuzzy search plugins, unless you absolutely cannot live without typo support and are willing to pay the price.

2 Likes

But I am using fuzzy search only for Google Places API input as a search autocomplete filter - why does it affect what’s there in the Database and unnecessarily fetch all the data ?

this functionality doesn’t make any sense actually

I don’t really understand your set up (Search and Auto Correct is a Fuzzy search plugin element, maybe it’s also used for places) but Bubble’s native searchbox supports the same thing.

Can’t say without knowing more about the specifics of your app, what workflows runs on page load, and what dynamic expressions on the page are evaluated on page load.

1 Like

My mistake, I wrote “Search and Autocorrect”,

I am actually using “Searchbox” already but the behaviour is still the same

Solved

Okay I seem to have solved this as per hint from George, the solution is to uninstall “Fuzzy Search and Autocomplete plugin”

Just in case if anybody is interested in root cause, my app had “Fuzzy Search and Autocomplete plugin” installed even though I was not using it actively on my application but it seems that Bubble IO framework is to load the functionality as per the plugins which are activated in the application ( even if not being used ).

The Fuzzy search plugin completely conflicts with the functionality of “Do a search for” and kind of breaks it, so the solution is to not use( even activate ) Fuzzy search plugin

Some plugins add headers to your pages. This will exist and run even if you did not put any plugin elements in the page.

I generally avoid Zerocode plugins altogether.

1 Like

:rofl: :100:

1 Like