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
- All projects deleted
Hello, from the appwrite console last week I re-activated some of my old project and published them, yesterday I checked and none of the apps were working, now ...
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...
- cant resume project
Invalid console fingerprint event i try man time