you were using the code i wrote for my site.
This should work for you. also here is a reference page for syntax and the data in results
import wixData from 'wix-data';
let lastFiltersearch
let debounceTimer
$w.onReady(function () {
//TODO: write your page related code here...
});
function update() {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#searchBar').value);
}, 200)
}
export function searchBox_keyPress(event, $w) {
update()
}
function filter(search) {
if (lastFiltersearch !== search) {
wixData.query('CATegory')
.contains('search', search)
.or(
wixData.query('CATegory')
.contains('caTegory', search)
)
.or(
wixData.query('CATegory')
.contains('mOrF', search)
)
.or(
wixData.query('CATegory')
.contains('county', search)
)
.find()
.then((results) => {
//the results are in filterData.items
})
.catch((err) => {
console.log(err);
})
}
}