Search Feature for Database

I am looking for a code so that I can search any keywords within a person’s job application. I would prefer it to be linked to a text box instead of a button so that it will automatically update with each keystroke. I think the solution might be fairly simple but I am new to this (as of today) and need some guidance as to how I would write this. what I have right now looks like this:

import wixData from ‘wix-data’;

$w.onReady(function () {
//TODO: import wixData from ‘wix-data’;
});

export function input1_keyPress(event, $w) {
wixData.filter(‘Applications’)
.contains((‘Input1’).value)
.find()
.then(res => {
(‘table1’).rows = res.items;
});
}

http://86vacancy.wixsite.com/86vacancy/applications-city is where I am trying to search

You can find a detailed explanation on our articles site: Velo Tutorial: Adding Collection Data Search Functionality | Help Center | Wix.com

This article tells how to create a search in a particular field but I am looking to search keywords throughout the entire database entry, not just one field. Any ideas?

There’s no way to search all field at once, you’d need to create a query on each relevant field using an or() clause.

How do I find out more about how to do that? I’m officially out of my comfort zone here.

import wixData from ‘wix-data’;

export function button1_click(event, $w) {
//Add your code for this event here:
wixData.query(‘Applications’)
.contains(‘name’, $w(‘#searchbox’).value)
.or(wixData.query(‘Applications’)
.contains(‘position’, $w(‘#searchbox’).value))
.find()
.then(res => {
$w(‘#table1’).rows = res.items;
});
}
So to anyone else having this issue, this is what the solution looks like:

.or(wixData.query(‘Applications’)
.contains(‘position’, $w(‘#searchbox’).value))

Duplicate these two lines as many times as needed to cover all of your fields, while changing ‘position’ to each particular field name as you go.