# Database search options

**URL:** <https://forum.wixstudio.com/t/database-search-options/28510>\
**Category:** Ask the community\
**Tags:** question, code, wix-members-area\
**Created:** [September 21, 2017, 12:09pm UTC](https://forum.wixstudio.com/t/database-search-options/28510 "2017-09-21T12:09:36Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![kean-tatt-ong](https://avatars.discourse-cdn.com/v4/letter/k/f17d59/32.png) [@kean-tatt-ong](https://forum.wixstudio.com/u/kean-tatt-ong)\
**Post date:** [May 2, 2018, 7:11am UTC](https://forum.wixstudio.com/t/database-search-options/28510/21 "2018-05-02T07:11:46Z")

</div>

Hi, I have question regarding search with multiple fields on my project: I have a collection with fullName, hour of credit hour, university and i want users to be able to search by name and also search by the combination of hour of credit hour and university. The part of search by name i just use simple search function shown at code i provided below but the combination search i can’t figure out how. I try wixData.query as above example shown but the repeater i used to display result cannot show the exact items. code sample:  
import wixData from ‘wix-data’;  
$w.onReady(function () {  
$w(‘#repeater1’).hide();  
wixData.query(“CSguru”)  
.find()  
.then((results) =\> {  
let sum = 0;  
results.items.forEach((item) =\> {  
sum += 1;  
});  
let sumString = sum.toString();  
$w(“#text18”).text = sumString; // display sum

```
	}); 
$w('#repeater1').onItemReady(($w, itemData, index) => { 
	$w(`#text21`).text = itemData.fullName; 
	$w('#text22').text = itemData.email; 
	$w('#image1').src = itemData.profilePhoto; 
	$w(`#text23`).text = itemData.about; 
	$w(`#text25`).text = itemData.hourOfTeaching.toString(); 
}); 

```

});

export function iconButton1\_click(event, $w) {  
//Add your code for this event here:  
let searchValue = $w(‘#input1’).value;  
let csguruCredit = $w(‘#input2’).value;  
$w(‘#repeater1’).show();  
wixData.query(‘CSguru’)  
.contains(“fullName”, searchValue)  
.or(wixData.query().contains(“hourOfTeaching”, searchValue))  
.find()  
.then(res =\> {  
$w(‘#repeater1’).data = res.items;  
})

}

export function input1\_keyPress(event, $w) {  
//Add your code for this event here:  
if (event.key === “Enter”) {  
let searchValue = $w(‘#input1’).value;  
$w(‘#repeater1’).show();  
wixData.query(‘CSguru’)  
.contains(“fullName”, searchValue)  
.find()  
.then(res =\> {  
$w(‘#repeater1’).data = res.items;  
})

```
} 

```

}

Please guide me…

[Previous page](https://forum.wixstudio.com/t/database-search-options/28510.md?page=1)
