lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <trej...@trypticon.org>
Subject Re: Lucene sort in AaZz order
Date Wed, 16 Jan 2019 02:36:59 GMT
On Wed, Jan 16, 2019 at 2:29 AM Adrien Grand <jpountz@gmail.com> wrote:
>
> Assuming that you need case-insensitive sort, the most straightforward
> way to do this would be to index the lowercase family name:
> SortedDocValuesField("by_name", new
> BytesRef(family.getName().toLowerCase(Local.ROOT))).
>
> It is also possible to implement a custom FieldComparatorSource, but
> this will likely be both more complicated and slower.

Probably actually want to use
toUpperCase(Locale.ROOT).toLowerCase(Locale.ROOT), and possibly even a
Normalizer.normalize before that. Unless you can use ICU's normaliser
with built-in case folding, which simplifies it a lot.

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message