# Whitespace tokenizer doesn't allow lowercase search?

**URL:** <https://discuss.elastic.co/t/whitespace-tokenizer-doesnt-allow-lowercase-search/99478>\
**Category:** Elasticsearch\
**Created:** [September 5, 2017, 7:29pm UTC](https://discuss.elastic.co/t/whitespace-tokenizer-doesnt-allow-lowercase-search/99478 "2017-09-05T19:29:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![truesecure](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@truesecure](https://discuss.elastic.co/u/truesecure)\
**Post date:** [September 5, 2017, 7:29pm UTC](https://discuss.elastic.co/t/whitespace-tokenizer-doesnt-allow-lowercase-search/99478/1 "2017-09-05T19:29:00Z")

</div>

Hello,

I want to use the whitespace tokenizer and be able to have my search be case insensitive.

However, I am unable to do case insensitive searches when using the whitespace tokenizer. This is what my settings look like ...

"analysis": {  
"analyzer": {  
"default": {  
"filter": "lowercase",  
"type": "whitespace",  
"tokenizer": "whitespace"  
}  
}  
}

What am I doing wrong? What should I do to fix it?

Thanks.

---

<div class="post-metadata">

**Author:** ![mvg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mvg/32/98890_2.png) [@mvg](https://discuss.elastic.co/u/mvg)\
**Post date:** [September 6, 2017, 5:24am UTC](https://discuss.elastic.co/t/whitespace-tokenizer-doesnt-allow-lowercase-search/99478/2 "2017-09-06T05:24:33Z")

</div>

In your analyzer config `type` should be set to `custom` and you should use a different name than `default` (`default` is already an built-in analyzer):

```auto
“analysis”: {
   “analyzer”: {
      “my_analyzer”: {
         "type": "custom",
         “tokenizer”: “whitespace”,
         “filter”: “lowercase”
      }
  }
}

```

Then in the mapping you can set the `analyzer` option to `my_analyzer` on text fields.

Also you don't need an custom analyzer for this, I think just using the built-in `simple` analyzer does the same thing. The only thing you need to do is set the `analyzer` option to `simple` on a text field.

---

<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:** [October 4, 2017, 5:24am UTC](https://discuss.elastic.co/t/whitespace-tokenizer-doesnt-allow-lowercase-search/99478/3 "2017-10-04T05:24:45Z")

</div>

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