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 <egor...@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-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
>


-- 
Adrien

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

Reply via email to