hi there
is it possible to have a searchbar that accepts multiple words and filters a repeater depending on the words that are entered in the searchbar?
at this moment i have a searchbar that only accepts 1 word that is looked up in 3 different columns of a database.
function filter(search) {
if (searchWord !== search) {
$w("#dataset1").setFilter(wixData.filter().contains('category', search)
.or(wixData.filter().contains("questions", search))
.or(wixData.filter().contains("explenation", search))
//Insert more field filter here ====> here <====
)
.then(countItems)
searchWord = search
}
}
for example, i have a database with 3 columns, category1, questions & explanations.
i want to do a search with multiple keywords separated by a space.
so for example: “iphone price”
so then it will search all the columns and check if one of these keywords is found in the values in one of these columns. and filter the repeater on these values.
Yes, you can combine it with any input type you want (checkbox, radio button, textinput, switch, selection tags, dropdown etc…).
Just take the input and filter the dataset based on the value(s).
So like I told before.
It should be 2 directional. It they start typing keywords in the search bar followed by the selection in the drop-down or the other wat around.