# "index": "not\_analyzed" in elasticsearch

**URL:** https://discuss.elastic.co/t/index-not-analyzed-in-elasticsearch/49567
**Category:** Elasticsearch
**Created:** [May 9, 2016, 3:10pm UTC](https://discuss.elastic.co/t/index-not-analyzed-in-elasticsearch/49567 "2016-05-09T15:10:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![stefansaye](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@stefansaye](https://discuss.elastic.co/u/stefansaye)
#### Post date: [May 9, 2016, 3:10pm UTC](https://discuss.elastic.co/t/index-not-analyzed-in-elasticsearch/49567/1 "2016-05-09T15:10:05Z")

</div>

i have delete mapping with the cmd

```
curl -XDELETE 'http://localhost:9200/logstash_log*/'

```

in my conf ,i have defined the index as follow,

```
output {
   elasticsearch {
   hosts => localhost
   index => "logstash_log-%{+YYYY.MM.dd}"
 }

```

and try to create a new mapping , but i got the error

```
 #curl -XPUT http://localhost:9200/logstash_log*/_mapping/log -d '

{

     "properties":{
          "@timestamp":"type":"date","format":"strict_date_optional_time||epoch_millis"},
           "message":{"type":"string"},
           "host":{"type":"ip"},
           "name":{"type":"string","index": "not_analyzed"},
           "type":{"type":"string"}
                }

}'

```

> {"error":{"root\_cause":[{"type":"index\_not\_found\_exception","reason":"no such index","resource.type":"index\_or\_alias","resource.id":"logstash\_log\*","index":"logstash\_log\*"}],"type":"index\_not\_found\_exception","reason":"no such index","resource.type":"index\_or\_alias","resource.id":"logstash\_log\*","index":"logstash\_log\*"},"status":404}

How can i fix it?  
any help will be appreciated!!

---

<div class="post-metadata">

### Author: ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)
#### Post date: [May 9, 2016, 4:20pm UTC](https://discuss.elastic.co/t/index-not-analyzed-in-elasticsearch/49567/2 "2016-05-09T16:20:41Z")

</div>

> [@stefansaye](#):
>
> logstash\_log\*

It looks like in the specified URL, the value above appeared to be an index name that does not exist. Check the document about mapping.

---

<div class="post-metadata">

### Author: ![stefansaye](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@stefansaye](https://discuss.elastic.co/u/stefansaye)
#### Post date: [May 10, 2016, 3:06am UTC](https://discuss.elastic.co/t/index-not-analyzed-in-elasticsearch/49567/3 "2016-05-10T03:06:16Z")

</div>

I have modify my logstash conf as below,

```
output {
   elasticsearch {
  hosts => localhost
  index => "logstash_log-%{+YYYY.MM.dd}"
  manage_template => true
  template_name => "log"
  template => "/path/to/index_template.json"
  template_overwrite => true
}

```

and add index\_template.json

```
{
   "template" : "log",
   "mappings": {
  "log": {
  "properties": {
  "@timestamp": {
  "type": "date",
  "format": "strict_date_optional_time||epoch_millis"
    },
"message": {
  "type": "string"
 },
"host": {
  "type": "ip"
},
"name": {
  "type": "string",
  "index": "not_analyzed"
},
  "type": {
  "type": "string"
        }
      }
    }
  }
}

```

but from the kibana settings/ indices ,it's still using default template ,  
any help would be appreciated.

---

<div class="post-metadata">

### Author: ![thn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thn/32/8061_2.png) [@thn](https://discuss.elastic.co/u/thn)
#### Post date: [May 10, 2016, 10:46am UTC](https://discuss.elastic.co/t/index-not-analyzed-in-elasticsearch/49567/4 "2016-05-10T10:46:33Z")

</div>

Generally, the template mapping for a given index is loaded once, you don't need to load it every time. Since I'm not familiar with the template thing in logstash, I will not be able to comment about that.

Here is the link about loading template from ES standpoint

[https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html)

---

<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:52pm UTC](https://discuss.elastic.co/t/index-not-analyzed-in-elasticsearch/49567/5 "2017-07-05T22:52:48Z")

</div>


