Back

full text search not working for me

  • 1
  • Databases
Dipen
16 Oct, 2023, 05:09

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??

TL;DR
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
16 Oct, 2023, 05:37

Are you wrapping with double quotes? If you are, then the order matters

Drake
16 Oct, 2023, 05:38

Otherwise... It could be because it's actually searching for word starting with carpet...

Dipen
16 Oct, 2023, 09:25

i haven't wrapped it in double or single quotes but i have it on the lowercase

Dipen
16 Oct, 2023, 09:25

does it matter?

Dipen
16 Oct, 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
16 Oct, 2023, 12:37

How should I complete it?

Dipen
16 Oct, 2023, 13:06

BTW i'm using flutter/dart

Drake
16 Oct, 2023, 16:55

No

Drake
16 Oct, 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

Red is probably ignored because it's too short

Dipen
17 Oct, 2023, 06:53

If I search for carpet it shows

Dipen
17 Oct, 2023, 06:54

both gives me empty array

Drake
17 Oct, 2023, 14:49

do you mean carpe?

Drake
17 Oct, 2023, 14:50

you mean "red carpet" gives empty array?

Dipen
27 Oct, 2023, 04:54

yea....

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more