# Sort and icu problem

**URL:** <https://discuss.elastic.co/t/sort-and-icu-problem/4640>\
**Category:** Elasticsearch\
**Created:** [June 16, 2011, 1:11pm UTC](https://discuss.elastic.co/t/sort-and-icu-problem/4640 "2011-06-16T13:11:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [June 16, 2011, 1:11pm UTC](https://discuss.elastic.co/t/sort-and-icu-problem/4640/1 "2011-06-16T13:11:05Z")

</div>

in order to sort on chinese, i used keworkd-tokenizer and icu\_collator  
filter, however, i also need to do facet on the same field, the  
problem now comes that the facet result is very not friendly as i can  
not read it.

besides i aslo want to search on this field, if i passed the result by  
icu\_collation to the query string, es will complains query parser  
failing.

i want to know why localized sort not supported and keep the original  
input not encoded by icu\_collator?

---

<div class="post-metadata">

**Author:** ![rmuir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rmuir/32/44949_2.png) [@rmuir](https://discuss.elastic.co/u/rmuir)\
**Post date:** [June 16, 2011, 1:46pm UTC](https://discuss.elastic.co/t/sort-and-icu-problem/4640/2 "2011-06-16T13:46:36Z")

</div>

On Thu, Jun 16, 2011 at 9:11 AM, Weiwei Wang [ww.wang.cs@gmail.com](mailto:ww.wang.cs@gmail.com) wrote:

> in order to sort on chinese, i used keworkd-tokenizer and icu\_collator  
> filter, however, i also need to do facet on the same field, the  
> problem now comes that the facet result is very not friendly as i can  
> not read it.
> 
> besides i aslo want to search on this field, if i passed the result by  
> icu\_collation to the query string, es will complains query parser  
> failing.
> 
> i want to know why localized sort not supported and keep the original  
> input not encoded by icu\_collator?

Maybe ES needs to hide more from you, but at the low level you need 2 fields:

1. the original text for faceting (keywordtokenizer)
2. the sort key field for sorting (collated)

the sort key field is really not useful for anything but sorting. its  
a binary sort key. this is the same way it works with all databases  
too (they just hide the process from you)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:03am UTC](https://discuss.elastic.co/t/sort-and-icu-problem/4640/3 "2017-07-06T04:03:19Z")

</div>


