#community-help

Managing Exact SKU Matches in Database Query

TLDR Sachyya is seeking to return exact product matches using SKU from a dataset. Kishore Nallan suggests disabling fuzzy matching by setting num_typos to 0 and prefix matching with prefix=false.

Powered by Struct AI
Jul 14, 2022 (15 months ago)
Sachyya
Photo of md5-3b78e17280dd19e5eca44e22ee940b76
Sachyya
11:43 AM
Hello,
I have a dataset of products which is being queried by query_by: sku,eon fields, on querying I want to get only the product having the exact match.
For example if I query by 1234 , result shows products with sku 1234 and eon 123. But I want to show only the product with sku 1234. How can this be achieved?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:49 AM
👋 You want to show products where both eon and sku match 1234?
Sachyya
Photo of md5-3b78e17280dd19e5eca44e22ee940b76
Sachyya
11:50 AM
No. I just want to show product with sku 1234 since it is the exact match. And do not show product with eon123
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
11:59 AM
Can you show me an example product JSON that matches for the query?
11:59
Kishore Nallan
11:59 AM
But I think what's happening here, you can just set num_typos=0 to ensure that fuzzy matching does not happen.
11:59
Kishore Nallan
11:59 AM
You can also disable prefix matching with prefix=false -- these two changes will ensure that you find the exact matches.
Sachyya
Photo of md5-3b78e17280dd19e5eca44e22ee940b76
Sachyya
12:55 PM
okay thank you. Will try it and get back to you