Search not working from home page

I am facing an issue with the search functionality. I have a text and a search button on my home page. When the user types a text to search and clicks on the search button I execute below code:


export function btnSearch_click(event, $w) {
//Add your code for this event here:
if (wixLocation.path==“search”) {
Search($w(“#cboCategory”).value,$w(“#txtSearch”).value.trim(),$w(“#repeater1”));
}
else {
wixLocation.to(“/search”);
}
}


The search page has a repeater control connected to the dataset. The dataset is linked to a database with no filters. Below is the code in the Search page:


$w.onReady(function () {
//TODO: write your page related code here…
Search($w(“#cboCategory”).value,$w(“#txtSearch”).value.trim(),$w(“#repeater1”));
});
export function Search(selectedCategory,selectedSearch,SearchRepeaterData) {
// convert the keywords array to an array of queries (one for each keyword)
const allQueries = keywords.map(keyword => queryByKeyword(selectedCategory,keyword))
// join the different queries into one query using OR
const joinedQuery = joinQueriesWithOr(allQueries)
joinedQuery.find()
.then( (results) => {
console.log(joinedQuery);
SearchRepeaterData.data = results.items;
} )
.catch( (err) => {
let errorMsg = err;
} );
}


The issue I am facing is that when the search page loads it first executes the Dataset query (without filters) and then user has to click again to search on the search page. Is there a way to bypass the default dataset query?

Thanks