[Solved] Query search not working even though I have created fullText indexes for the attribute
- 0
- Databases
- Web
What indexes do you have and what's the query you're making?
Here are the two collections with virtually the same indexes
Here's the queryArray that produces the server error:
['orderDesc("$createdAt")', 'equal("parent_folder", ["test3"])', 'search("question", ["music"])']
Do indexes need to have unique names across collections
which one has the error?
Both of them though the second one only works with the parent_folder and orderDesc queries. The first one works with all the queries except any that involve searchTerm (for the question attribute)
The docker error suggests the same thing showing that there's an issue with the fullText indexes
btw, is there a way to nest documents so that I don't have to use the parent_folder attribute?
Would you please try adding a full text index on question only?
normalization is the best approach. so separating out data into separate collections.
We are working on relationships which could simplify some of that, though.
Oh ok, yeah, I've separated out the data with the parent folder being in a different collection but renaming the parent folder means I have to update the parent_folder attributes of all the documents the parent_folder relates to. Similar case with deletion. That's why I was wondering if there was a nesting mechanism since updating all of that would take up a significant amount of resources just to rename or delete one parent folder document
I deleted the old attributes and added just a question one and then a question one with a parent_folder one combined and it worked
I think there might have been an error or glitch in the creation of the old indexes. Maybe something to do with the name because I only used one underscore this time
I'll add indexes one by one and see if they still work. If they do, I'll mark this as solved
Also, I will add the independent indexes of the attributes in case that maybe the problem even though they won't be used independently during a query
I'm not sure what you mean....to link things, I would use IDs so the name is only in 1 place...
it's only required for the full text since you're searching on 1 attribute
Oh ok, thanks. Do you have any suggestions for how I should handle deletion or should I just do it the normal way of deleting everything with the matching parent_folder when the parent folder document is deleted
Ya that sounds reasonable. Probably recursively
Sorry, I'm relatively new to web development, why would I need to do the deletion recursively? My idea was to use a for loop after obtaining the document IDs of the documents matching my criteria
for path a/b/c/d, if i delete a, i have to delete b. then, c, then d
Oh, ok, I understand now, thanks!
Also, recreating the indexes like this solved the issue so I'll mark the problem as solved
Thanks for the help with everything!
[Solved] Query search not working even though I have created fullText indexes for the attribute
Recommended threads
- Sudden CORS Errors - Domain hasn't Chang...
I have an Appwrite project with two web apps configured, the first one has the hostname `*` and the second one I just added to test if it could fix the issue wi...
- Any way to temporarily bypass the email ...
Hey guys, any way to bypass the email verification to use the accounts again? i need to recover some projects that due to recent changes have been stopped, and ...
- Collections list not showing up when try...
I'm trying to create new relationship attribute but both one way and two way relationship is not showing up collections list to connect with my relationship att...