Search bar on header

Hi Ido, as i mentioned from the home page the search bar works by redirecting me to the results page, but once i get there the search doesn’t work anymore. This my code in the home page: import {local} from ‘wix-storage’;

import wixLocation from ‘wix-location’;

$w.onReady( function () {

});

export function searchButton_click() {

let word = $w(“#searchBar”).value;

local.setItem("searchWord", word); 

wixLocation.to(`/results`); 

}
and on the results : import { local } from ‘wix-storage’;
import wixData from ‘wix-data’;

var sameWord ;
sameWord = local.getItem(“searchWord”);
$w.onReady( function () {
$w(“#searchBar”).value = sameWord;
// $w(“#searchBar1”).placeholder = sameWord;
$w(‘#dataset1’).onReady( function () {
console.log(sameWord )
search();

}); 

});

export function searchButton1_click() {
search();
}

function search() {
wixData.query(‘Stores/Products’)
.contains(‘name’, $w(“#searchBar1”).value)
.find()
.then(res => {
$w(‘#repeater1’).data = res.items;
});

}
Thanks.