Quick question about coding on a search bar.

Hi, I have some issue about coding

So I have a search bar called #iSearch which I want it to be able to filter the database depending on text input. It works fine, by the following code.

export function iSearch_keyPress(event) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {

inputSearch($w('#iSearch').value); 
}, 500); 

}

function inputSearch(Search) {
$w(‘#dataset1’).setFilter( wixData.filter().contains(‘program’, Search));
$w(‘#dataset1’).setFilter( wixData.filter().contains(‘group’, Search));
$w(‘#dataset1’).setFilter( wixData.filter().contains(‘highlights’, Search));
}

But the last 2 lines (highlighted in green color) didn’t work, only the first line with the ‘program’ field key worked.
So my question is how to make this search bar work for more than one fields. Thanks for helping.

Any help here ?? :frowning:

You should chain your contains filters on the first line. i.e. contains().contains().contains()