How to create a string attribute without specifying size. If i want to store an article when i try to enter size 4000 i am getting an error about attribute size while creating. This error goes when i reduce the size of other attribute.
Summary
Issue: The user is encountering an error when adding a string attribute with a size longer than 768 characters in Appwrite.
Solution: The maximum index size for string attributes in MariaDB is 768 characters, so if the attribute size exceeds this limit, only the 'fulltext' index can be added. To edit the size after creating the attribute without losing values, high values such as '> 65535' or '> 16777215' can be used. If an error occurs while adding an attribute, reducing the size of other attributes may resolve it.
Binyamin
Sep 4, 2023, 15:33
Go for really high values
> 65535
> 16777215
As you can see here from certain values Appwrite will use specify MariaDB type, so in your case aims toward LONGTEXT
Karthik
Rank 2: Process
Sep 4, 2023, 17:09
Is there any way to edit size after creating attribute without losing values ?.
ok, any idea about the error i faced during adding attribute size ? .
Drake
Sep 5, 2023, 21:56
what was the exact error?
Karthik
Rank 2: Process
Sep 6, 2023, 16:42
Actually i use appwrite cli to create collection. But during that time i deleted that collections multiple times. so after a few attempts i started getting this error while creating attribute it was something like attribute max exceed. Now i am not able to recreate that error i can save any size.
Drake
Sep 6, 2023, 17:46
could have been too many big attributes. since you're not facing this anymore, can this be closed?
Karthik
Rank 2: Process
Sep 7, 2023, 08:01
what is mean by this error "Index length is longer than the maximum: 768" ?
Binyamin
Sep 7, 2023, 12:46
This is when you're trying to cerate index other then fulltext on a string attribute that is longer than 768 characters.
Meaning when your string attribute is too long the only index you can add for it is the fulltext one
As adding indexes longer than that aren't support by MariaDB and probably won't help performance wise.
Karthik
Rank 2: Process
Sep 8, 2023, 09:12
ok thanks
Infinil
Rank 6: Server
Sep 10, 2023, 05:26
Infinil
Rank 6: Server
Sep 10, 2023, 05:27
i am getting that for 128 size array of strings attribute