couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aurélien Bénel <aurelien.be...@utt.fr>
Subject Re: Custom Collation
Date Sat, 02 Sep 2017 17:54:48 GMT
Hi Cliff,

> I am using a language where the sort order for the alphabet is:
>    A B D E F G H I J K L M N O P R S Š Z Ž T U V Õ Ä Ö Ü
> I need to sort the keys for my views based on this order.  So:
> A a B b ... Ö ö Ü ü
> Is there any way to achieve this?

I know this is not exactly what you are trying to do, but in similar situations I « normalize
» keys before emitting them (transforming « Š » and « s » into « S » for example).
You can still get the original (unnormalized) words in the `doc` or `value` field. Even if
« S*** », « s*** » and « Š*** » will not be sorted *for real*, they will be next to
each other in the sorted list.

Implementation is trivial but here is an implementation: 
https://github.com/Hypertopic/Tire-a-part/blob/d54018e8a81ceedfcbac7c921152e58989ec406b/lib/string.js

Regards,

Aurélien
Mime
View raw message