I’m struggling to resolve this issue. I have a search set up to search two fields in a dataset. If, for example, I search for Bush, the repeater linked to the dataset shows the correct answer. If I search for Bethel, again the repeater shows the correct answer. If I enter Bush Bethel (or vice versa) then the repeater doesn’t show anything.
Could anyone tell me where I’m going wrong?
Thanks!
import wixData from wix-data;
let debounceTimer
function update() {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#filterText').value);
}, 1000);
}
export function search_click(event) {
console.log($w('#filterText').value);
filter($w('#filterText').value);
}
function filter() {
$w('#dataset2').setFilter(
wixData.filter()
.contains("content", $w("#filterText").value)
.or(
wixData.filter()
.contains("keyword", $w("#filterText").value)
)
);
}
export function clear_click(event) {
$w("#filterText").value = "";
$w("#filterText").resetValidityIndication();
$w("#dataset2").setFilter(wixData.filter());
}