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
- Cloud function deployment failures
When I run appwrite push functions, select the function I want to deploy, confirm with a YES, is starts deploying but goes into error. I need to repeat the ste...
- Function deployment failed: Unable to re...
Hi Appwrite team, I have been experiencing persistent errors when i attempt to push my appwrite functions. The logs on the deployment detail page on the console...
- One to many 2 way, console UI not correc...
Hey, seems I'm facing the exactly same issue with this one: https://github.com/appwrite/appwrite/issues/6016 Since this Github issue stay open for so long, let ...