Exact match

Exact match.pngExact match.png
Filtering documents with "Durian Leather 2 Seater Sofa" as the product_name.


This filter works with string values and only returns documents with a field value that exactly matches the filtered criteria. For instance under filtering by 'Samsung galaxy s21', the result will only contain products explicitly having 'Samsung galaxy s21' in their specified field. Note that this filter is case-sensitive.

# remove `!` if running the line in a terminal
!pip install -U RelevanceAI[notebook]==2.0.0
from relevanceai import Client

You can sign up/login and find your credentials here: https://cloud.relevance.ai/sdk/api
Once you have signed up, click on the value under `Activation token` and paste it here
client = Client()
DATASET_ID = "ecommerce-sample-dataset"
ds = client.Dataset(DATASET_ID)
filter = [
        "field": "product_name",
        "filter_type": "exact_match",
        "condition": "==",
        "condition_value": "Durian Leather 2 Seater Sofa"
filtered_data = ds.get_documents(filters=filter, n = 20)

Did this page help you?