Seem like a really bad idea to repeat that kind of behaviour in my opinion. You should make a search results page like your dynamic page and redirect the user to that page when clicking the search button in the header.
wixLocation(“url-to-search-results-page?search=” + $w(“searchBarID”).value);
That way you will get the search word in the url when you get to the page and you can use wixLocation.query to get the value
let query = wixLocation.query;
let searchWord = query.search;
Then use your filters and everything will work great.