I would like my search functionality to search through 4 different fields. It’s working perfectly for 2 fields, but not the referenced field. I tried .toString() but it does not seem to work.
Here is the code:
export function searchButton_click(event) {
wixData.query("Vendors")
.contains("name".toLowerCase(), $w("#searchInput").value.toLowerCase())
.or(
wixData.query("Vendors")
.contains("skill1".toString().toLowerCase(), $w("#searchInput").value.toLowerCase()) //NOT SEARCHING SKILL1
)
.or(
wixData.query("Vendors")
.contains("skill2".toString().toLowerCase(), $w("#searchInput").value.toLowerCase()) //NOT SEARCHING SKILL2
)
.or(
wixData.query("Vendors")
.contains("city".toLowerCase(), $w("#searchInput").value.toLowerCase())
)
.find()
.then(res => {
$w("#repeaterVendors").data = res.items;
});
}
The search is working for “name” and for “city” but not for “skill1” and “skill2”, which are both referenced fields. (The foreign referenced fields are Strings. But I am converting with toString() and still not working.
Any advice?