# Elasticsearch - searching with "keyword" type don't work

**URL:** <https://discuss.elastic.co/t/elasticsearch-searching-with-keyword-type-dont-work/118050>\
**Category:** Elasticsearch\
**Created:** [February 1, 2018, 3:22pm UTC](https://discuss.elastic.co/t/elasticsearch-searching-with-keyword-type-dont-work/118050 "2018-02-01T15:22:43Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [February 1, 2018, 4:26pm UTC](https://discuss.elastic.co/t/elasticsearch-searching-with-keyword-type-dont-work/118050/6 "2018-02-01T16:26:04Z")

</div>

I don't know exactly as I don't fully understand what you are doing. It would be better to provide a full recreation script as described in [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

Not using Java but just with simple recreation that you can run in Kibana console.

Most likely, when you index a field `"foo": "BAR"`, with a default analyzer, `foo` is indexed as `bar`. With a `keyword` type, it's indexed as `BAR`.

When running a match query for example on that field, searching for `BaR` in the former case will transform to `bar` and it will match.  
Searching for `BaR` in the later case won't match `bar`.

You can understand all that by using the `_analyze` API.

---

_[View the full topic](https://discuss.elastic.co/t/elasticsearch-searching-with-keyword-type-dont-work/118050)._
