Back

Fulltext searching

  • 0
  • Databases
  • Web
Shahil Algoo
5 Jun, 2023, 17:28

Hello, I created an index of type fulltext with multiple attributes. I'm using Query.search() but it's giving this error. Can you guys help me?

TL;DR
The user is asking about how to perform a fulltext search in their application. They are wondering if it's possible to search for a specific term in multiple attributes at the same time. A suggestion is given to either make separate queries or create a new attribute with all the data and search on that attribute. There is also mention of a related issue on GitHub that the user may find helpful. The user also asks about the usage of `Query.search()` and how to search for a term in multiple attributes. There is no solution provided for the error mentioned by the user.
Drake
5 Jun, 2023, 17:42

The first parameter to Query.search() should be the attribute you want to search on

Shahil Algoo
5 Jun, 2023, 17:45

Wouldn't Query.search("body", "dog") search only in 'body'? What if i want to search 'dog' in the title at the same time?

Drake
5 Jun, 2023, 17:49

if you want something like:

TypeScript
title contains dog OR subtitle contains dog OR body contains doc

you'll either need to make separate queries or create an attribute that has all of the data and search on that attribute

You might want to 👍🏼 this related issue: https://github.com/appwrite/appwrite/issues/2740

Shahil Algoo
5 Jun, 2023, 17:55

thank you!

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