# Cant get search database to work like in video

**URL:** <https://forum.wixstudio.com/t/cant-get-search-database-to-work-like-in-video/20300>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [September 10, 2019, 5:54pm UTC](https://forum.wixstudio.com/t/cant-get-search-database-to-work-like-in-video/20300 "2019-09-10T17:54:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![coachbradb2017](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coachbradb2017/32/14520_2.png) [@coachbradb2017](https://forum.wixstudio.com/u/coachbradb2017)\
**Post date:** [September 10, 2019, 5:54pm UTC](https://forum.wixstudio.com/t/cant-get-search-database-to-work-like-in-video/20300/1 "2019-09-10T17:54:30Z")

</div>

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 🙂

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));  
}

---

<div class="post-metadata">

**Author:** ![coachbradb2017](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coachbradb2017/32/14520_2.png) [@coachbradb2017](https://forum.wixstudio.com/u/coachbradb2017)\
**Post date:** [September 10, 2019, 5:59pm UTC](https://forum.wixstudio.com/t/cant-get-search-database-to-work-like-in-video/20300/2 "2019-09-10T17:59:32Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [September 10, 2019, 9:07pm UTC](https://forum.wixstudio.com/t/cant-get-search-database-to-work-like-in-video/20300/3 "2019-09-10T21:07:32Z")

</div>

For starters you are missing your onReady page function underneath your imports line.  
[https://www.wix.com/corvid/reference/$w.html#onReady](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](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-CUSTOMIZED-SEARCH-BAR-USING-REPEATERS)  
[https://www.vorbly.com/Vorbly-Code/WIX-REPEATER-WITH-SEARCH-BAR](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](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://www.youtube.com/watch?v=ZiKcx2nlrkw)  
[https://codequeen.wixsite.com/search-redirect](https://codequeen.wixsite.com/search-redirect)

[Wix Code Tutorial | How to Create an Easy Search Bar Using Wix Code](https://www.youtube.com/watch?v=xujaBNElgjw)

```javascript
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))) ;
} 

```

---

<div class="post-metadata">

**Author:** ![coachbradb2017](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coachbradb2017/32/14520_2.png) [@coachbradb2017](https://forum.wixstudio.com/u/coachbradb2017)\
**Post date:** [September 11, 2019, 1:50am UTC](https://forum.wixstudio.com/t/cant-get-search-database-to-work-like-in-video/20300/4 "2019-09-11T01:50:27Z")

</div>

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