Database search

import wixData from 'wix-data';
export function searchButton_onClick(event) {
let searchValue = $w('#searchButton').value;
let searchWords = searchValue.split(' ');
let query = wixData.query('my-collection')
.contains('physicalIssue', searchWords[0]);

for (let i=1; i < searchWords.length; i++) {
query = query.or(wixData.query('my-collection')
.contains('physicalIssue', searchWords[i]));
}

query.find()
.then(res => {
$w('#resultsTable').rows = res.items;
});
}