If anyone is trying to create a page with a single search field that will search multiple fields within a database, you can try this code. My results are displayed in a table connected to a dataset.
import wixData from "wix-data";
$w.onReady(function (){
});
let debounceTimer;
export function iSearchBar_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#iSearchBar').value);
}, 200);
}
function filter(title, contact, postcode) {
$w('#dataset1').setFilter(wixData.filter()
.contains('title', $w('#iSearchBar').value)
.or(wixData.filter()
.contains('contact', $w('#iSearchBar').value))
.or(wixData.filter()
.contains('postcode', $w('#iSearchBar').value))
)
}