Search Bar for Collections

I need a search bar that will search items in collections. Most of the examples also use a drop-down and I do not want to use the drop-down and search feature. I just want the search bar. I followed the example using a chart and the code all looks correct and is still not working. Please help!

Hi! For that you need Wix Code, Repeater, Text Input.

In this Code you can search two Values.

$w.onReady(function () {
});

let debounceTimer;
export function button_keyPress(event, $w) {
    if (debounceTimer) {
        clearTimeout(debounceTimer);
        debounceTimer = undefined;
    }
    debounceTimer = setTimeout(() => {
        filter($w('#text').value);
    }, 200);
}

let lastFilterTitle;
function filter(title) {
    let SearchValue1 = $w("#text").value;
    let filter = wixData.filter().contains('title', SearchValue1).or(wixData.filter().contains('value1', SearchValue1).or(wixData.filter().contains('value2', SearchValue1)));

$w("#database").setFilter(filter);
}

If i have helped you, please make my post as “Best Answer”, thanks :slight_smile: