Shop - setFilter on Products Collection does not work

Hi,

I’m trying to set up a keyword search on the “products” database using a simple repeater for results and setFilter to filter the dataset.

Here is the relevant code snippet. This works BUT ONLY for the “name” field. If I filter on anything else (e.g. description in the example below) it does not seem to work:


let filter = wixData.filter();
filter = filter.contains( "description", "MY SEARCH STRING" );
$w("#dataset1").setFilter(filter);

Can anyone please help me?

Thanks

Check the Wix Stores collections and make sure that you are using what can be used with each field.
https://support.wix.com/en/corvid-by-wix/wix-stores-with-corvid

Like the name field in the Wix Stores Products collection.

Name (name)

Description : The name of the product.
Type : Text
Can connect to data : Yes
Can use in dynamic page URL : No
Can be sorted : Yes
Can be filtered : eq, ne, hasSome, contains, startsWith
Read-only : Yes