Why isn't my search function working?

Hey, I am trying to make a search bar to search through a collection list. The weird thing is that I copy and pasted this code from another search bar I made in another part of the website. That search bar works fine…This one does not.

let debounceTimer;
export function searchBar_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w(‘#searchBar’).value);
},200);
}

let lastFilterTitle

function filter(title) {
if (lastFilterTitle!== title) {
const byFirstName = wixData.filter().contains(‘studentFirstName’, title);
const byLastName = wixData.filter().contains(‘studentLastName’, title);

    $w("#youthGroup").setFilter(byFirstName.or(byLastName)); 
    lastFilterTitle = title; 
} 

}

Hey, like most things in coding I figured it out once I posted. I didn’t set the function to run for the “On Key Press” when I copy and pasted over.