# Setting "not\_analyzed" on an Index Field

**URL:** <https://discuss.elastic.co/t/setting-not-analyzed-on-an-index-field/167026>\
**Category:** Elasticsearch\
**Created:** [February 4, 2019, 9:01pm UTC](https://discuss.elastic.co/t/setting-not-analyzed-on-an-index-field/167026 "2019-02-04T21:01:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudyamid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rudyamid/32/38393_2.png) [@rudyamid](https://discuss.elastic.co/u/rudyamid)\
**Post date:** [February 4, 2019, 9:01pm UTC](https://discuss.elastic.co/t/setting-not-analyzed-on-an-index-field/167026/1 "2019-02-04T21:01:37Z")

</div>

I'm trying to set a field not to be analyzed so I can search for "/" slashes (as in URL requests). After searching the past questions and on google, the answer seems to be to make the index "not\_analyzed". However, when I tried this on my environment, I get a status 400 error:

```
{
  "error": {
    "root_cause": [
      {
        "type": "resource_already_exists_exception",
        "reason": "index [apachelogs-support-2019.01.31/84jgHStuRoO9N0I9end2Jg] already exists",
        "index_uuid": "84jgHStuRoO9N0I9end2Jg",
        "index": "apachelogs-support-2019.01.31"
      }
    ],
    "type": "resource_already_exists_exception",
    "reason": "index [apachelogs-support-2019.01.31/84jgHStuRoO9N0I9end2Jg] already exists",
    "index_uuid": "84jgHStuRoO9N0I9end2Jg",
    "index": "apachelogs-support-2019.01.31"
  },
  "status": 400
}

```

This is how I attempted to change the index field:

```
PUT apachelogs-support-2019.01.31
{
  "mappings": {
    "doc": {
     "properties": {
      "request": {
        "type": "text",
        "index": "not_analyzed"
      }
     }
    }
  }
}

```

I suspect I got the syntax wrong, can anyone verify?

Thanks  
Rudy

---

<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 4, 2019, 9:22pm UTC](https://discuss.elastic.co/t/setting-not-analyzed-on-an-index-field/167026/2 "2019-02-04T21:22:10Z")

</div>

That's not the update settings api.  
But anyway if the field was already existing you can't change it.  
You need to drop the index, create it again and reindex.

---

<div class="post-metadata">

**Author:** ![rudyamid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rudyamid/32/38393_2.png) [@rudyamid](https://discuss.elastic.co/u/rudyamid)\
**Post date:** [February 4, 2019, 9:33pm UTC](https://discuss.elastic.co/t/setting-not-analyzed-on-an-index-field/167026/3 "2019-02-04T21:33:56Z")

</div>

Ok, thanks for the clarification.

---

<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:** [March 4, 2019, 9:33pm UTC](https://discuss.elastic.co/t/setting-not-analyzed-on-an-index-field/167026/4 "2019-03-04T21:33:58Z")

</div>

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