Rank 2: Process
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.
Votes
1
Replies
15
Participants
Unknown
Messages
16
Rank 2: Process
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.
Rank 2: Process
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
Rank 2: Process
String
Admin
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?
Rank 2: Process
I am using the cloud, I expect to get back one document that meets both of those criteria.
Admin
See my 2nd paragraph
Would you please provide exact input and the matching document?
Rank 2: Process
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.
Rank 2: Process
thanks for help
Rank 2: Process
[SOLVED] Error trying to list documents using 2 queries
Admin
Btw, if you're using equal, you don't need the full text indexes