# ES 5.0 - case insensitive search for keyword fields

**URL:** <https://discuss.elastic.co/t/es-5-0-case-insensitive-search-for-keyword-fields/64111>\
**Category:** Elasticsearch\
**Created:** [October 27, 2016, 8:16am UTC](https://discuss.elastic.co/t/es-5-0-case-insensitive-search-for-keyword-fields/64111 "2016-10-27T08:16:53Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![fabiocatalao](https://avatars.discourse-cdn.com/v4/letter/f/779978/32.png) [@fabiocatalao](https://discuss.elastic.co/u/fabiocatalao)\
**Post date:** [January 27, 2017, 10:17am UTC](https://discuss.elastic.co/t/es-5-0-case-insensitive-search-for-keyword-fields/64111/10 "2017-01-27T10:17:48Z")

</div>

I've added a custom analyser:

> "analyzer": {  
> "folding": {  
> "tokenizer": "standard",  
> "filter": ["lowercase", "asciifolding"]  
> }  
> },

I've also added a dynamic template in order to set the datatype of my fields. I've the following for keyword.

> {  
> "string\_as\_keyword": {  
> "match\_mapping\_type": "string",  
> "match": "\*\_k",  
> "mapping": {  
> "type": "keyword",  
> "analyzer": "folding"  
> }  
> }  
> },

Is that correct? How can I query my data? I've found a lot of information about older versions but not for 5.0.

---

_[View the full topic](https://discuss.elastic.co/t/es-5-0-case-insensitive-search-for-keyword-fields/64111)._
