# Romanization keyword sorting (specifically Pinyin)

**URL:** <https://discuss.elastic.co/t/romanization-keyword-sorting-specifically-pinyin/264558>\
**Category:** Elasticsearch\
**Created:** [February 17, 2021, 11:23am UTC](https://discuss.elastic.co/t/romanization-keyword-sorting-specifically-pinyin/264558 "2021-02-17T11:23:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![UserName3](https://avatars.discourse-cdn.com/v4/letter/u/f9ae1b/32.png) [@UserName3](https://discuss.elastic.co/u/UserName3)\
**Post date:** [February 17, 2021, 11:23am UTC](https://discuss.elastic.co/t/romanization-keyword-sorting-specifically-pinyin/264558/1 "2021-02-17T11:23:47Z")

</div>

Hi,

Is sorting by Romanization, specifically Pinyin supported currently?

It should be sorted along other languages with Roman alphabet, so the sorting results should be in an order like this:

1. a,
2. b,
3. C, // ignore case
4. j,
5. jA,
6. Jb,
7. JC,
8. 姐 (Jiě), // consider the transliteration
9. s,
10. 石 (Shí),
11. x,
12. 小 (Xiǎo),
13. z

For now a normalizer with lowercase and asciifolding filters is used for the text keyword:

```auto
PUT test
{
  "settings": {
    "analysis": {
      "normalizer": {
        "my_normalizer": {
          "type": "custom",
          "char_filter": [],
          "filter": [
            "lowercase",
            "asciifolding"
          ]
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "name": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword",
            "normalizer": "my_normalizer",
            "ignore_above" : 256
          }
        }
      }
    }
  }
}

```

Thanks

---

<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:** [March 17, 2021, 11:24am UTC](https://discuss.elastic.co/t/romanization-keyword-sorting-specifically-pinyin/264558/2 "2021-03-17T11:24:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
