# How to determine if a field is analyzed or not\_analyzed?

**URL:** <https://discuss.elastic.co/t/how-to-determine-if-a-field-is-analyzed-or-not-analyzed/54852>\
**Category:** Elasticsearch\
**Created:** [July 6, 2016, 5:01pm UTC](https://discuss.elastic.co/t/how-to-determine-if-a-field-is-analyzed-or-not-analyzed/54852 "2016-07-06T17:01:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fikse](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@fikse](https://discuss.elastic.co/u/fikse)\
**Post date:** [July 6, 2016, 5:01pm UTC](https://discuss.elastic.co/t/how-to-determine-if-a-field-is-analyzed-or-not-analyzed/54852/1 "2016-07-06T17:01:04Z")

</div>

`must: { term: { ... }}` fails but `must: { match: { ... }}` has hits.

1. `term` will only work for `not_analyzed` fields, correct?
2. How can I see if a field is `not_analyzed`?

---

<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:** [July 6, 2016, 5:20pm UTC](https://discuss.elastic.co/t/how-to-determine-if-a-field-is-analyzed-or-not-analyzed/54852/2 "2016-07-06T17:20:31Z")

</div>

1. No.

term will work without applying any analysis transformation to your request.

Which means that it can also work against a analyzed or not analyzed field.

For example, if you index with a standard analyzer the following text: `BrOWN foX` and you search with a term query for `fox` or `brown`, it will find the doc.

If you search for `BrOWN` it won't match.

1. `GET index/_mapping`

---

<div class="post-metadata">

**Author:** ![fikse](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@fikse](https://discuss.elastic.co/u/fikse)\
**Post date:** [July 6, 2016, 5:26pm UTC](https://discuss.elastic.co/t/how-to-determine-if-a-field-is-analyzed-or-not-analyzed/54852/3 "2016-07-06T17:26:25Z")

</div>

I performed this request:

`GET /_all`

From there I could see the field isn't analyzed as expected.

```auto
          "request": {
            "type": "string",
            "norms": {
              "enabled": false
            },
            "fielddata": {
              "format": "disabled"
            },
            "fields": {
              "raw": {
                "type": "string",
                "index": "not_analyzed",
                "ignore_above": 256
              }
            }

```

@dadoonet `GET logstash-2016.07.04/_mapping` worked as well.

I'm not sure why `must: { term: { ... }}` fails, but I suppose that's another question.

---

<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:** [July 6, 2016, 5:54pm UTC](https://discuss.elastic.co/t/how-to-determine-if-a-field-is-analyzed-or-not-analyzed/54852/4 "2016-07-06T17:54:30Z")

</div>

My guess is that your query is wrong.

If you send [a full script to reproduce that](https://discuss.elastic.co/t/about-the-elasticsearch-category/21), I can explain what is happening.

---

<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:** [July 5, 2017, 10:37pm UTC](https://discuss.elastic.co/t/how-to-determine-if-a-field-is-analyzed-or-not-analyzed/54852/5 "2017-07-05T22:37:36Z")

</div>


