combining data of several fields into one for multiple search boxes

I get the concept of the hook https://support.wix.com/en/article/how-to-display-calculated-data-from-a-collection

But I am wanting to combine several fields into one field for a search. I have a search bar and a drop down menu for search. I want the search bar to search two or more fields (or combine those fields together into one search field) and then have the drop down. The code was simple setup for just search bar and drop down per the wix tutorials and info on here. However, combining that with a need for that search bar to search multiple fields is having me go in circles.

Thoughts?

UPDATE: fyi, I should have used an afterQuery for my desire. Using an afterquery seen below, will populate a new field from other fields within a database that can then be used.

My “new” field is Search (item id is search). I am pulling data from city and title fields. You can keep repeating for other fields such as shown in my second example where I added field “section”. If your database has no entry in a field to be added, a “undefined” will appear in your new field in space where a result would have populated
export function OurOzarksData_afterQuery(item, context) {
item.search = item.title + ", " + item.city;
return item;
}

This is after adding another field to show how you keep adding add’l
export function OurOzarksData_afterQuery(item) {
item.search = item.title + ", " + item.city + item.section;
return item;
}

Hi Jeff,

I’m trying to do something similar, but I want to include text from a reference field, do you happen to know how to do that?