this code will return a filtered repeater with no items if the search is “a text” when there are repeats with names “a text”, “b text”, “c text”
this code will return all items if the names are the same ie “a text”, “b text”
//How can I filter and return multiple items with part of the search string?
$w(“#datasetMainData”).setFilter(wixData.filter().contains(“subData”, item.subData._id));
//example of the code below that filters a repeater
var foundfItems;
export function buttonSearch_click(event, $w) {
wixData.query(“Main_Data”)
.include(“subData”)
.find()
.then(res => {
res.items.forEach((item) => {
let itemName = item.subData.itemName;
let subItem = item;
if (itemName.toLowerCase().includes($w(“#iSearchRepeater”).value.toLowerCase())) {
foundItems.append(item.subData._id);
//console.log(itemName);
//console.log(item);
//$w(“#datasetMainData”).setFilter(wixData.filter().contains(“subData”, item.subData._id));
}
});
});