# Search not innitializing

**URL:** <https://forum.ionicframework.com/t/search-not-innitializing/66583>\
**Category:** ionic-v3\
**Created:** [October 11, 2016, 6:07pm UTC](https://forum.ionicframework.com/t/search-not-innitializing/66583 "2016-10-11T18:07:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![racheal](https://avatars.discourse-cdn.com/v4/letter/r/ee7513/32.png) [@racheal](https://forum.ionicframework.com/u/racheal)\
**Post date:** [October 11, 2016, 6:07pm UTC](https://forum.ionicframework.com/t/search-not-innitializing/66583/1 "2016-10-11T18:07:23Z")

</div>

Hei Yall  
What am i doin wrong here;  
The searchbar is not popin up the searched [item.Am](http://item.Am) i missing something.Heres my code:

```
export class MyPage {

```

searchQuery: string = ‘’;  
items;  
constructor(public navCtrl: NavController,menu: MenuController,

{

```
this.initializeItems();

```

}  
initializeItems() {  
this.items = [  
‘Amsterdam’,  
‘Bogota’,  
‘Buenos Aires’,  
‘Cairo’,  
‘Dhaka’,  
‘Edinburgh’,  
‘Geneva’,  
‘Genoa’,  
‘Glasglow’,  
‘Hanoi’,  
‘Hong Kong’,  
‘Islamabad’,  
‘Istanbul’,  
‘Jakarta’,  
‘Kiel’,  
‘Kyoto’,  
‘Le Havre’,  
‘Lebanon’,  
‘Lhasa’,  
‘Lima’,  
‘London’,  
‘Los Angeles’,  
‘Madrid’,  
‘Manila’,  
‘New York’,  
‘Olympia’,  
‘Oslo’,  
‘Panama City’,  
‘Peking’,  
‘Philadelphia’,  
‘San Francisco’,  
‘Seoul’,  
‘Taipeh’,  
‘Tel Aviv’,  
‘Tokio’,  
‘Uelzen’,  
‘Washington’  
];

}  
getItems(searchbar) {  
// Reset items back to all of the items  
this.initializeItems();

```
// set q to the value of the searchbar
var q = searchbar.value;

// if the value is an empty string don't filter the items
if (q.trim() == '') {
  return;
}

this.items = this.items.filter((v) => {
  if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) {
    return true;
  }
  return false;
})

```

}

Then in the html page i did the following:

 ""Empty"" 

```
<ion-content> 

```

```
  <ion-avatar item-left>
    <img src="icons/icondefault.png">
  </ion-avatar>
  <h2>{{ item }}</h2>
</ion-item>

```

But search is not returning a searched item like in the demo app.
