How to connect search filters to a repeater not connected to a dataset/collection?

Hi All,

I have two repeaters (#repeater1 & #repeater2) on a dynamic page. Both are not connected to a dataset/collection as both are populated via code based on a dataset #marks. I am trying to connect a search bar (#iheadline) and a dropdown (#icategory) for both repeaters, for users to search posts by headline and by category. As the repeaters are not connected to a dataset the standard way, I am struggling with the code.

The code below is what I used for a different repeater that is connected to a dataset the standard way and it works fine:

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

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

function filter(headline, category) {
if (lastFilterheadline !== headline || lastFiltercategory !== category) {
let newFilter = wixData.filter();
if (headline)
newFilter = newFilter.contains( ‘headline’ , headline);
if (category)
newFilter = newFilter.eq( ‘category’ , category);
$w( ‘#dynamicDataset’ ).setFilter(newFilter);
$w( ‘#marksunmarked’ ).setFilter(newFilter);
lastFilterheadline = headline;
lastFiltercategory = category;
}
}

export function icategory_change(event, $w) {
filter(lastFilterheadline, $w( ‘#icategory’ ).value);
}

export function resetFilter_click(event) {
$w( ‘#icategory’ ).value = “” ;
$w( ‘#icategory’ ).resetValidityIndication();
$w( “#icategory” ).selectedIndex = 0 ;
$w( “#dynamicDataset” ).setFilter(wixData.filter());
}

Thanks in advance