After much frustration and time spent on getting my search results page to function correctly and the great amount of help from the community, I felt it necessary to provide some insight into how I accomplished this feat.
My project is a hotel listing site. This could be redone for any type of listing site.
Firstly, the database needs to be set up correctly. My search results are displaying hotel listings. So, I set up in the database a Data Type of Hotel Listing. The hotel listings will have different Data Fields such as Property Type, Overall Rating, Property Facilities, Price etc.
Each Data Field in the Hotel Listing Data Type should be linked to another Data Type. For example, my Data Field of Property Type is actually a Data Type of Property Type in the database. This is set to a singular entry as each hotel listing could only have one possible property type.
Another example is that my Data Field of Property Facilities is again linked to a Data Type of Property Facilities. This is set to be a list of Property Facilities because each hotel listing will have more than one facility.
So basically, any sort or filter parameter that you will use for the search results, if you want the user to select multiple of that parameter, it must be set in the database as a list.
Secondly, comes the set up of custom states. For every search sort or filter parameter, you need a custom state for that. I have set all of my custom states on the page the search results are displayed on.
In your workflows you need to set the state of these. For example, I have buttons to set the sate of the neighborhood.
Then you need to set up your repeating group to display the results of the search. You will need to set this up with a filter so a user can select from the different parameters.
Pay attention to the advanced function of the filter constraints. This is so that when a hotel listing has multiple property facilities and you want only to display properties that have all of the selected facilities (not all properties with any of the selected).
Without this set up you will return results for all properties that have any of the selected property facilities. What I wanted was for any property that HAS ALL of the selected property facilities in itâs list of property facilities from the hotel listing data field of property facilities list to be displayed.
After this you will need to set conditionals in the repeating group to change the data source so that you can set the sort parameters.
It is important to set the sort before you set the filters. I donât know why this has to be, but if you were to try and set filters before you set the sort you will get no results displayed. Big thanks to @mente12 for help with that.
I wonât go into all the details about how to set the custom states or how to get to display the sort or filter options on the page for a user to select or deselect.
One tip though when working with custom states, is to on the page set a display of what the current custom state setting is so you can see if they are getting set correctly, and to help troubleshoot.
Thanks again to all those you have helped me with this.
@NigelG @mente12 @keith @mebeingken @dan1 @emmanuel
All had played a role me continuing my development on Bubble and giving me much needed assistance, often for free, and helping the community. Much appreciated.
Now back to building.
For references I had posted the following questions in the community forum.