Skip to content
Back

Query.search() limitation

  • 0
  • Databases
Infinil
20 Nov, 2023, 14:24

I created a fulltext index for my attribute containing list of anime titles. Lets say I want to search for "Attack on Titan" .. how can i achieve this without having to type from the start. Like is there a way to perform contains() search for specific words such as titan?

TL;DR
The user is experiencing a limitation with the Query.search() function in Appwrite. They confirmed that it is an Appwrite limitation and not a problem on their side. They are discussing different approaches to handle partial matches in full text search (FTS). One suggestion is to tokenize the search query by words, while another approach is to create a list of tokens for each anime title. The user is seeking guidance on the best approach to search for specific words like "titan" without having to type the entire search query from the start. Solution: It is suggested to tokenize the search query by words and create a list of tokens for each anime
Infinil
20 Nov, 2023, 14:24

Another approach i was thinking of was to create a list of all the tokens separated by space

Infinil
20 Nov, 2023, 14:24

like 'Attack on Titan' can be 'attack', 'on', 'titan'

Infinil
20 Nov, 2023, 14:25

but is this even a good approach?

Infinil
20 Nov, 2023, 14:25

plus i have a list of titles so considering each item in list getting further divided might be bad for performance?

Ernest
20 Nov, 2023, 17:15

😲 Didn't even realise FTS index does not work for partial matches. I think tokenizing by words is your best bet. Maybe a collection of tokens related to the anime data collection

Infinil
20 Nov, 2023, 17:16

hmmm

Infinil
20 Nov, 2023, 17:16

u tested it as well?

Ernest
20 Nov, 2023, 17:18

Yes, just did. I mean, by my understanding of FTS it should work for partial matches which some DBs implement with hashed tokens

Infinil
20 Nov, 2023, 17:19

yep getting u

Infinil
20 Nov, 2023, 17:19

i was confirming because wanted to make sure its not a problem from my side xd

ideclon
20 Nov, 2023, 19:05

No, it isn’t. This is currently an Appwrite limitation

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