lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrien Grand <jpou...@gmail.com>
Subject Re: Lucene sort in AaZz order
Date Tue, 15 Jan 2019 17:19:56 GMT
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.

On Tue, Jan 15, 2019 at 5:59 PM egorlex <egorlex@gmail.com> wrote:
>
> Hi
>
> Hi all, i need help with understand how Lucene sort works.
>
> This is example how i create sort field.
>
>  document.add(new SortedDocValuesField("by_name", new
> BytesRef(family.getName())));
>
> And when i make sort by name i get result in this order - azAz, but i need
> AaZz.
>
> Could someone help me with this?
>
> Thanks.
>
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>


-- 
Adrien

---------------------------------------------------------------------
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