Search bar error

Hey, The search bar code isn’t working on my site. i believe the code is right . please help me out.

import wixData from “wix-data”;

export function iTitle_keyPress(event,$w) {
filter($w(‘#iTitle’).value);
}

function filter(title)
{
$w(‘#dataset1’).setFilter(wixData.filter().contains(‘Name’, title));

}

when i start searching i don’t see the results.for your information i connected the input text field to the correct dataset.

Hi,

Try changing the field name from ’ Name ’ to ’ name ’ as field names usually start with a lowercase character.

$w('#dataset1').setFilter(wixData.filter().contains('name', title));