Hi, my DB has values such as “black pants” and “black track pants”. When some searches for black pants I want the result to be black pants only and not black track pants in the result. So DB entries look like “Brand small black pants” and/or “XXL black track pants” and similar variations.
Can someone suggest a way to accomplish this? I am using contains keyword(s) in the constraint.
thanks, fuzzy search will return just black pants or both black pants and black track pants?
I’m not affiliated to them but I use this plugin. Fuzzy Search & Autocomplete Plugin for Bubble | Zeroqode
I think it would return entries that have the word black, blak, pats, pants, etc. as a list based on the underlying algorithm and some parameters you can set.
I don’t understand it’s workings for it works well for my use case of a simple table search…
1 Like
Have you tried this with Contains instead of Contains Keywords? I’m not 100% it’ll do the trick, but the behavior of the 2 is different enough it may work like you need.
2 Likes
How it works is it loads the entire search result to the page and then does the filtering client side. So if your user is only looking for a handful of products but your Search results a listing of 1000, your app is loading 1000 records to find that handful.
The better practice is to use Search Constraints without advanced filters :filtered operator. You might need to revise your DB structure to support the search UX you want.
1 Like
thanks but I am using constraints. guess will either give contains a shot or fuzzy search.
Ill try that but i think contains looks for exact phrase match.
will give this a shot. thanks.
Contains looks for closer to an exact match in word order, including case/capitalization, and includes partial words. Contains keywords will look for certain words in any order, regardless of case - but not partial words.
thanks, Ill come back and test this after Im done building another feature. seems like it will do the trick.
This depends on your “Threshold“ settings. it’s a number between 0.0 & 1.0 where 0.0 means a perfect match. Usually I use it with 0.2 and gives me nearby or approximate acceptable results