My repeater is not populating with the query() code I wrote.

I am very new to coding and I am struggling to learn and create a dictionary. This is my code.

export function searchButton_click() {
    search(); 
}
function search() {
    wixData.query("jargons")
        .contains("word", $w("#searchBar").value)
        .find()
        .then(results => {
            $w("#repeater2").data = results.items;
        });
}

The idea is to populate search results using query on the column “word” in the collection “jargons”. I want the results to be in each container within the repeater. But when I search, all the results are coming and the query is not executing.

what do you get when you console.log(results.items)

Your query looks correct

The repeater gets populated with the linked data. Also I have my search bar in the header and not in the page. So I have the code for search bar in massterPage.js
Could that be a problem?

import { local } from 'wix-storage';
 
import wixLocation from 'wix-location'; 

function runSearch(){
 let word = $w("#searchBar").value;
 local.setItem("searchWord", word);
 wixLocation.to(`/search-results`);
}
$w.onReady(function () {
 $w("#searchBar").onKeyPress( (event) => {
  if(event.key === "Enter"){
  runSearch();
  }
 })
}); 
export function searchButton_click(event) { 
 runSearch();
}

This is the code for search bar in the header under masterPage.js