# Sorting text fields case insensitive

**URL:** https://discuss.elastic.co/t/sorting-text-fields-case-insensitive/79922
**Category:** Elasticsearch
**Created:** [March 24, 2017, 4:23pm UTC](https://discuss.elastic.co/t/sorting-text-fields-case-insensitive/79922 "2017-03-24T16:23:11Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wgerlach](https://avatars.discourse-cdn.com/v4/letter/w/94ad74/32.png) [@wgerlach](https://discuss.elastic.co/u/wgerlach)
#### Post date: [March 24, 2017, 4:23pm UTC](https://discuss.elastic.co/t/sorting-text-fields-case-insensitive/79922/1 "2017-03-24T16:23:11Z")

</div>

Hi,

using ES 5.2.2 I am trying to create a schema that allows me to sort by text fields:

> "project\_name" : {  
> "type": "text",  
> "fields": {  
> "keyword": {  
> "type": "keyword",  
> "normalizer" : "lowerasciinormalizer"  
> }  
> }  
> },  
> with  
> "normalizer": {  
> "lowerasciinormalizer": {  
> "type": "custom",  
> "filter": ["lowercase", "asciifolding"]  
> }  
> },

a) I notice that when I do not specify the normalizer, I can sort (case sensitive). When I specify the normalizer I can not sort at all! So, what can I do to get the normalizer to work and be able to sort case insensitive?

b) I noticed that when I call the field "raw" instead of "keyword", sorting also does not work. I am surprised as I would have thought that I can name it whatever I want, as long as I specify "type": "keyword" !?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [March 31, 2017, 6:09am UTC](https://discuss.elastic.co/t/sorting-text-fields-case-insensitive/79922/2 "2017-03-31T06:09:40Z")

</div>

Can you send a full script to reproduce your issue?

---

<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: [April 28, 2017, 6:09am UTC](https://discuss.elastic.co/t/sorting-text-fields-case-insensitive/79922/3 "2017-04-28T06:09:58Z")

</div>

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