I'm using full text search on product name
I have listed product name as this
Carpet Red 123
Dustbin Red 134
Carpet Blue 233
when I try to search for "Carpet Red", it works fine but when I search for "Red Carpet" it doesn't show the product.
How do I achieve this result??
Summary
The user is experiencing an issue with their full text search. When searching for "Red Carpet", the results are empty, but when searching for "Carpet Red", the product is shown. The user is using Flutter/Dart and their query looks like this: `Query.search("name", search)`. The issue might be related to the order of the words or the use of quotes. The solution might be to wrap the search phrase in double quotes, like `"Red Carpet"`, and make sure the order of the words matches the product name.
Drake
Oct 16, 2023, 05:37
Are you wrapping with double quotes? If you are, then the order matters
Drake
Oct 16, 2023, 05:38
Otherwise... It could be because it's actually searching for word starting with carpet...
Dipen
Rank 3: Container
Oct 16, 2023, 09:25
i haven't wrapped it in double or single quotes but i have it on the lowercase
Dipen
Rank 3: Container
Oct 16, 2023, 09:25
does it matter?
Dipen
Rank 3: Container
Oct 16, 2023, 12:37
Query.search("name", search),
My query looks like this where search is string
when I get this in console search("name", ["red carpet"])
It shows like this.
Dipen
Rank 3: Container
Oct 16, 2023, 12:37
How should I complete it?
Dipen
Rank 3: Container
Oct 16, 2023, 13:06
BTW i'm using flutter/dart
Drake
Oct 16, 2023, 16:55
No
Drake
Oct 16, 2023, 16:56
In that case...I think it's because we add a wildcard at the end of the search. Try searching for carpe and compare with carpet