# Searching not analyzed term name and value in case insensitive manner

**URL:** <https://discuss.elastic.co/t/searching-not-analyzed-term-name-and-value-in-case-insensitive-manner/50537>\
**Category:** Elasticsearch\
**Created:** [May 20, 2016, 7:51am UTC](https://discuss.elastic.co/t/searching-not-analyzed-term-name-and-value-in-case-insensitive-manner/50537 "2016-05-20T07:51:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [May 24, 2016, 7:05am UTC](https://discuss.elastic.co/t/searching-not-analyzed-term-name-and-value-in-case-insensitive-manner/50537/2 "2016-05-24T07:05:18Z")

</div>

Hi @nrmohta,

you can use the keyword tokenizer:

```auto
PUT /my_index
{
   "settings": {
      "analysis": {
         "analyzer": {
            "case_insensitive": {
               "tokenizer": "keyword",
               "filter": [
                  "lowercase"
               ]
            }
         }
      }
   },
   "mappings": {
      "my_type": {
         "properties": {
            "name": {
               "type": "string",
               "analyzer": "case_insensitive"
            }
         }
      }
   }
}

```

```auto
PUT /my_index/my_type/1
{
    "name": "Neeraj"
}

```

```auto
GET /my_index/_search?q=name:Neeraj
GET /my_index/_search?q=name:neeraj 

```

For further details see [Elasticsearch: The Definitive Guide](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/sorting-collations.html#case-insensitive-sorting).

To your question for the migration path: When you change the analyzer, you have to reindex your old data.

Daniel

---

_[View the full topic](https://discuss.elastic.co/t/searching-not-analyzed-term-name-and-value-in-case-insensitive-manner/50537)._
