Cant get search database to work like in video

I have watched the video on how to create a search box with a repeater.
I think I have the code exactly like it was type with my changes for titles.
It will load the box and the repeater just like in the video but when I type something in the search box nothing happens. Here is the code. Thanks for any help. Been 30 years since I coded :slight_smile:

import wixData from “wix-data” ;
export function ititle_keyPress(event, $w) {
console.log($w(‘#ititle’).value);
filter($w(‘#ititle’).value);
}
function filter(title){
$w(‘#dataset1’).setFilter(wixData.filter().contains(‘Type’, title));
}

So the images load up initially and I think what it is doing is not reloading them when I start the search. I tested it and the data is going into the search box and hitting the right dbase.

For starters you are missing your onReady page function underneath your imports line.
https://www.wix.com/corvid/reference/$w.html#onReady

Plus, if you are using onKeyPress, then you might want to use setTimeout out too, see here for more info.
https://www.wix.com/corvid/forum/community-discussion/give-the-textinput-onkeypress-function-some-time

Or these
https://www.vorbly.com/Vorbly-Code/WIX-CUSTOMIZED-SEARCH-BAR-USING-REPEATERS
https://www.vorbly.com/Vorbly-Code/WIX-REPEATER-WITH-SEARCH-BAR
https://www.wix.com/corvid/forum/community-discussion/search-function-for-a-repeater-1

Easy Search Code for Wix Code - 2018 - Display Results on another page
https://codequeen.wixsite.com/search-redirect

Wix Code Tutorial | How to Create an Easy Search Bar Using Wix Code

Import wixData from 'wix-data' ;

$w.onReady (function () {
//TODO: write your page related code here...
}) ;

export function input1_keyPress(event, $w) {
let searchValue = $w("#input1").value;
$w("#dataset1).setFilter(wixData.filter().contains('name', searchValue).
or(wixData.filter().contains('city', searchValue))) ;
} 

Thanks guys. Will work in this. I thought I was perhaps missing something that I was supposed to do before this stage.