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?
Summary
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
Rank 6: Server
Nov 20, 2023, 14:24
Another approach i was thinking of was to create a list of all the tokens separated by space
Infinil
Rank 6: Server
Nov 20, 2023, 14:24
like 'Attack on Titan' can be 'attack', 'on', 'titan'
Infinil
Rank 6: Server
Nov 20, 2023, 14:25
but is this even a good approach?
Infinil
Rank 6: Server
Nov 20, 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
Nov 20, 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
Rank 6: Server
Nov 20, 2023, 17:16
hmmm
Infinil
Rank 6: Server
Nov 20, 2023, 17:16
u tested it as well?
Ernest
Nov 20, 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
Rank 6: Server
Nov 20, 2023, 17:19
yep getting u
Infinil
Rank 6: Server
Nov 20, 2023, 17:19
i was confirming because wanted to make sure its not a problem from my side xd
ideclon
Rank 5: Hypervisor
Nov 20, 2023, 19:05
No, it isn’t. This is currently an Appwrite limitation