When i try to search trough a collection using search queries I get error 500, bellow is an image how I wrote it in flutter and how i made an index in the cloud console.
not sure if this will work, but can you try creating 2 seperate indexes for the 2 attributes?
another point - is there a reason why you're using Query.search
instead of Query.equal
?
If you're trying to return the values that match the date and userId, I think Query.equal
will work better.
I did try creating both but it then said it can’t find index “date, userId” even tho I had them created. And I found that using equal throws an error for some reason. Both userId and date are strings
what error does equal
throw?
as for the search
query, I'm not sure what could be causing this issue. have you checked your collection Id?
Also, what's the data type of the date
attribute in the collection? Is it a String
or DateTime
String
Whenever you get a 500 error, you need to check the docker logs for the appwrite container to see the details of the error.
That said, your problem is probably that you need a full text indext on each attribute. So 1 for date and another for userId.
Also...why are you searching on these? What's are you passing for the value and what are you expecting to get back?
I am using the cloud, I expect to get back one document that meets both of those criteria.
See my 2nd paragraph
Would you please provide exact input and the matching document?
An update, I solved it by creating 2 more indexes one for each (date, userId), and instead of using search i used .equal and now I get precisely what I want.
thanks for help
[SOLVED] Error trying to list documents using 2 queries
Btw, if you're using equal, you don't need the full text indexes
Recommended threads
- [SOLVED] OAuth With Google & Flutter
Hi all, I'm trying to sign in with google and it all goes swimmingly until the call back. I get a new user created on the appwrite dashboard however the flutte...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...
- My organization's project is blocked
My organization's project is blocked so unblocked my organization then I will this