i got a deadline in few hours. i'm trying to create an index with DateTime and String attribute, in full-text type. cuz i need to search
the string attribute. but it's getting failed every time. is it just a temporary glitch? or we can't have full-text
type index with DateTime attributes?
Hey 👋 You can check logs of docker compose logs appwrite-worker-databases
to see error message
I got a really big text after running this command. the only red line I can notice there is Index already exists
, which isn't true in my case
I've tried creating my index just with the string
type attribute with the index type of fullText
, just to check if my logic is correct. tho this time the index creation is successful, but the Query.search()
isn't working properly. my queried attribute is a string array type. let's say the attr name is "X". I'm passing an array as the 2nd arg in Query.search
. let's name the passed array "Y".
this code is expected to return all the docs where "X" contains any value from "Y". But it's returning 0 docs. I've tried this method before, which worked perfectly. but not sure why this ain't working now.
You can't have full text indexes with attributes that aren't string. See https://github.com/appwrite/appwrite/issues/2995
It could be the length of the keyword you're passing into the search. For more info on how the search works see https://github.com/appwrite/appwrite/discussions/5005#discussioncomment-4681079
but my situation kinda requires me to do that. i need to check if a string array type attribute contains some text, also if a DateTime type attribute is in a range. is there any way for me to do that?
seems search
doesn't work with values that are less than 3. my value is a length of 2. now adding dummy text on it is the only way left for me?
Can you give more concrete examples of the values?
You should be able to use greater than and less than on datetime attributes. Just make sure you send an iso format string in utc
Yes, dummy text would be the way to go. Either that or don't use an array attribute. But use a separate collection instead
that's my code. the betDigitArray
is a string array type attribute and betDay
is DateTime. it's not like I'm not getting the expected data after the request. I can't even create an index with attributes where one is DateTime and the other is String
What's winnersArray
?
You're passing the current datetime (down to the second). Do you have a document in your database with the exact datetime?
winnersArray
is the array that I wanna search in betDigitArray
.
yeah, I just noticed I passed the current time, which I don't have in my document (i have but not the exact. only date is same). but as of now, the code isn't the problem ig. we can't even create the index. so until I create it, I can't even start to debug
True...make sure to 👍🏼 the issue I linked before
Recommended threads
- Update User Error
```ts const { users, databases } = await createAdminClient(); const session = await getLoggedInUser(); const user = await users.get(session.$id); if (!use...
- apple exchange code to token
hello guys, im new here 🙂 I have created a project and enabled apple oauth, filled all data (client id, key id, p8 file itself etc). I generate oauth code form...
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...