I just want to know can we sort a string alphabetically if it is analyzed .
On Mon, 2012-07-02 at 11:51 +0530, jajoria abhishek wrote:
I just want to know can we sort a string alphabetically if it is
No. You can't sort on a field that has multiple values, and an analyzed
string has multiple tokens.
Instead, you can use multi_fields to have two versions of the same
field: one analyzed, and one not analyzed (to be used for sorting)
But sorting on a field type=keyword does not result in an alphabetic order (in german language we have ä,ö,ü). The only way I found out to result in an alphabetic order, is to mark the field analyzer=german, fielddata=true which takes a lot of memory from the heap.
Any ideas to avoid fielddata for correct alphabetical sorting in german language ?
Sorting on strings uses unicode codepoint order. To customize this for German, you probably want to use the icu plugin. See https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-icu-collation.html.