Data Collection Search Bar and Drop-Down Menu Filtering

I have a customer with a search requirement similar to that shown in the “ Wix Code | How to Create a Search for Your Database ” video. I have created a search bar and a drop-down filter and added some additional lines of code. The drop-down filter is working fine, but I have not been able to get the search bar to work. When a term is entered, and you hit the enter key, nothing happens. If someone could look at my code and tell me where I’ve erred, I would be most appreciative.

import wixData from “wix-data”;

$w.onReady(() => {
loadACFreelancers();
});

let lastFilterExpertise;
let lastFilterCategory;
let debounceTimer;
export function iCategory_change(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w(‘#iExpertise’).value, lastFilterCategory);
}, 500);
}

export function iCategory_click_1(event) {
filter(lastFilterExpertise, $w(‘#iCategory’).value);
}

function filter(expertise, category) {
if (lastFilterExpertise !== expertise || lastFilterCategory !== category) {
let newFilter = wixData.filter();
if (expertise)
newFilter = newFilter.contains(‘expertise’, expertise);
if (category)
newFilter = newFilter.contains(‘category’, category);
const filterValue = $w(“#iCategory”).value
const byAssignment = wixData.filter().contains(“assignment”, filterValue)
const byHumanities = wixData.filter().contains(“humanities”, filterValue)
const bySocialSciences = wixData.filter().contains(“socialSciences”, filterValue)
const byTopics = wixData.filter().contains(“topics”, filterValue)
const byOther = wixData.filter().contains(“other”, filterValue)
$w(“#dataset1”).setFilter(byAssignment.or(byHumanities).or(bySocialSciences).or(byTopics).or(byOther))
$w(‘#dataset1’).setFilter(newFilter);
lastFilterExpertise = expertise;
lastFilterCategory = category;
}
}

function loadACFreelancers() {
wixData.query(‘ACFreelancers’)
.find()
.then(res => {
let options = [{“value”: ‘’, “label”: ‘All Categories’}];
options.push(…res.items.map(expertise => {
return {“value”: expertise.category, “label”: expertise.category};
}));
$w(‘iCategory’).options = options;
});

}

This question can be closed. I was able to resolve the issue with the help of code provided by several forum members.