How do you add a filter to the results produced by referencing another database with an input element?

I am using a repeater to display support articles on a webpage and I have one support article database for all article types. I set the dataset named “Support Article” to filter based on the dataset named “Website Look”. To filter the dataset named “Support Article” I have set the filter to

Field: Page ID
Condition: Is
Value: Another Dataset
Dataset: Website Look
Field: Page ID

This works to display the correct support articles in the beginning but then I added a search box using an input element and once you start your second search the filters listed above no longer apply to the dataset.

Thanks!

import wixData from "wix-data";

let debounceTimer;
export function iHeadline_keyPress(event, $w) {
 if (debounceTimer) {
        clearTimeout(debounceTimer);
        debounceTimer = undefined;
    }
    debounceTimer = setTimeout(() => {
        filter($w('#iHeadline').value);
    }, 200);
}

let lastFilterHeadline;
function filter(headline) {
 if (lastFilterHeadline !== headline) {
        $w('#dataset4').setFilter(wixData.filter().contains('headline', headline));
        lastFilterHeadline = headline
    }
}