#community-help

Locale Specific Sorting Issue in TypeSense (Cloud)

TLDR Viliam inquired if TypeSense supports locale specific sorting. Kishore Nallan confirmed that Typesense only supports English-based sorting. Viliam then decided to create a separate field for sorting.

Powered by Struct AI
+11
4
8mo
Solved
Join the chat
Jan 24, 2023 (8 months ago)
Viliam
Photo of md5-de7d9f39ab7cc1b36ec064eaa8f30c4d
Viliam
03:51 PM
Hello, does TypeSense (cloud) support sorting by locale specific rules? In collection settings there is locale field, which i have set to czech ("cs"), but it doesnt seem to work (Č should be after C but it seems that sorting does ignore diacritics so this happens: ČA, CB, ČC, CD but should be: CB, CD, ČA, ČC . Thanks
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
07:11 PM
CC: Kishore Nallan
Jan 25, 2023 (8 months ago)
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:01 AM
We don't support locale based sorting. It's very difficult to get that right across languages and will require additional indexing and book keeping also. Typesense string sorting just sorts the unicode characters, so that works only for English.
Viliam
Photo of md5-de7d9f39ab7cc1b36ec064eaa8f30c4d
Viliam
07:58 AM
ok, thanks... I'm gonna just generate a separate field only for sorting purposes... 🙂
+11