# Problem with sort with polish(POLAND) words!

**URL:** <https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417>\
**Category:** Elasticsearch\
**Created:** [January 31, 2017, 8:14pm UTC](https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417 "2017-01-31T20:14:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matizgal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matizgal/32/8827_2.png) [@matizgal](https://discuss.elastic.co/u/matizgal)\
**Post date:** [January 31, 2017, 8:14pm UTC](https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417/1 "2017-01-31T20:14:54Z")

</div>

Please, help me people with my problem.

I've got that mapping:

"some\_field: {type: 'string', store: 'true', analyzer: 'keyword'}"  
in this field i've got words "Śrem" "Żnin" with polish sign.

When i do sort on this data, elastic returned sorted data:  
a,b,c,d,...,z, ś, ł, ż

What's wrong with my sort?

Anybody can help me ? ?

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [February 1, 2017, 8:46am UTC](https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417/2 "2017-02-01T08:46:18Z")

</div>

Hi,

Maybe you can try to add the asciifolding filter to normalize all char and have the good sort ?

[https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-asciifolding-tokenfilter.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-asciifolding-tokenfilter.html)

---

<div class="post-metadata">

**Author:** ![matizgal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matizgal/32/8827_2.png) [@matizgal](https://discuss.elastic.co/u/matizgal)\
**Post date:** [February 1, 2017, 9:12am UTC](https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417/3 "2017-02-01T09:12:52Z")

</div>

Thanks it's good point. But a I have some question.. I must change mapping for that field in my elastic ?

---

<div class="post-metadata">

**Author:** ![xavierfacq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xavierfacq/32/8744_2.png) [@xavierfacq](https://discuss.elastic.co/u/xavierfacq)\
**Post date:** [February 1, 2017, 10:37am UTC](https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417/4 "2017-02-01T10:37:56Z")

</div>

Yes, you have have to change the analyser in the index mapping, then create a new index and re-index your data ...

Something like that:

```
{
    "template" : "your-next-index-name-*",
    "order" : 0,
    "settings" : {
	"analysis": {
	    "analyzer": {
		"polish_asciied": {
		    "type": "custom",
		    "tokenizer": "standard",
		    "filter": ["lowercase", "asciifolding", "trim"]
		}
	    }
      }
    },
    "mappings" : {
	"your_type": {
	    "properties": {
		"your_polish_field" : {
		  "type": "string",
		  "analyzer": "polish_asciied"
		    }
	    }
      }
  }
}
```

---

<div class="post-metadata">

**Author:** ![matizgal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matizgal/32/8827_2.png) [@matizgal](https://discuss.elastic.co/u/matizgal)\
**Post date:** [February 1, 2017, 10:42am UTC](https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417/5 "2017-02-01T10:42:14Z")

</div>

You're right. It's working 🙂 Thanks for help.

---

<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 1, 2017, 10:42am UTC](https://discuss.elastic.co/t/problem-with-sort-with-polish-poland-words/73417/6 "2017-03-01T10:42:14Z")

</div>

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