Categories

Filtering documents with "LG" or "Samsung" as the brand.Filtering documents with "LG" or "Samsung" as the brand.

Filtering documents with "LG" or "Samsung" as the brand.

categories

This filter checks the entries in a database and returns ones in which a field value exists in a given filter list. For instance, if the product name is any of Sony, Samsung, or LG. Note that this filter is case-sensitive.

from relevanceai import Client 
client = Client()

filter =  [{'field' : 'brand',                          # field to look at
            'filter_type' : 'categories', 
            "condition":"==", 
            "condition_value":["LG","samsung"]}]  # searching for brands LG and Samsung
filtered_data = client.datasets.documents.get_where(dataset_id, filter)

Did this page help you?