# The final mapping would have more than 1 type Error - Intermittent

**URL:** <https://discuss.elastic.co/t/the-final-mapping-would-have-more-than-1-type-error-intermittent/125370>\
**Category:** Elasticsearch\
**Created:** [March 23, 2018, 1:29pm UTC](https://discuss.elastic.co/t/the-final-mapping-would-have-more-than-1-type-error-intermittent/125370 "2018-03-23T13:29:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 23, 2018, 1:29pm UTC](https://discuss.elastic.co/t/the-final-mapping-would-have-more-than-1-type-error-intermittent/125370/1 "2018-03-23T13:29:05Z")

</div>

Hi Team,

I am currently observing the below error. Strangely, it worked for the first time, later on I had to an additional field (Tag) to my data and that was the only change I have done and now i get the mapping error. I was not able to figure out the reason behind it and now when i remove the field i added, I still get this error. ELK version - 6.2.3

Error:

> `[2018-03-23T06:15:30,271][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"healthccms-2018.03.23", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x6ac12f62>], :response=>{"index"=>{"_index"=>"healthccms-2018.03.23", "_type"=>"doc", "_id"=>"sffsf_HFKJ_sajfkjf6", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"Rejecting mapping update to [healthccms-2018.03.23] as the final mapping would have more than 1 type: [my_doc, doc]"}}}}`

**Update 2:**  
When i changed my mappings name to `doc`, i get the below error. I see there is nothing relevant to the error i got and the template i have.

`[2018-03-23T06:46:57,483][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"healthccms-2018.03.23", :_type=>"doc", :_routing=>nil}, #<LogStash::Event:0x3a60947e>], :response=>{"index"=>{"_index"=>"healthccms-2018.03.23", "_type"=>"doc", "_id"=>"gjYcU2IB9pgc1BKZxkks", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Could not convert [message.index] to boolean", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Failed to parse value [not_analyzed] as only [true] or [false] are allowed."}}}}}}`

My Mapping Template:

```
{
  "template" : "healthccms-*",
  "settings" : {
    "index.refresh_interval" : "10s"
  },
 "mappings" : {
     "my_doc": {
	   "dynamic_templates" : [
          {
            "message_field" : {
              "path_match" : "message",
              "mapping" : {
               "type" : "keyword", "index" : "not_analyzed", "omit_norms" : true
           },
              "match_mapping_type" : "string"
            }
          },
          
		  {
		    "integers": {
            "match_mapping_type": "long",
            "mapping": {
              "type": "integer"
            }
          }
        },
		  
		  {
            "string_fields" : {
              "mapping" : {
                "type" : "text", "index" : "analyzed", "norms": false,
                "fields" : {
                  "keyword" : {"type": "keyword", "index" : "not_analyzed", "ignore_above" : 1024}
                }
              },
              "match_mapping_type" : "string",
              "match" : "*"
            }
          }
        ],
      
       
  "properties" : {
"@timestamp" : { "format" : "dateOptionalTime","type" : "date" },
"@version":{ "type": "keyword" },
"host": { "type": "keyword" },
"path": { "type": "keyword" },
"ETime": { "type": "date", "format" : "dateOptionalTime" },
"OverAllStatus": { "type": "integer" },
"Env": { "type": "keyword" },
"HostAddress": { "type": "keyword" },
"ThresholdDiskSpace": { "type": "keyword" },
"Tag": { "type": "integer" }
    
       }
    }
  }
}

```

I see in the documentation that the mapping contains more than 1 type, i actually didn't understand what does that mean. Can someone help me understand what is the issue in the template and how can i overcome it.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 24, 2018, 8:12am UTC](https://discuss.elastic.co/t/the-final-mapping-would-have-more-than-1-type-error-intermittent/125370/2 "2018-03-24T08:12:43Z")

</div>

It looks like you might be using the mapping syntax from an old version. Your definition of the parameters apart from `type` are not correct. Have a look at the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/keyword.html) for a full list of options. In this case I suspect you are fine with just specifying `type` to be `keyword` and then use the defaults.

---

<div class="post-metadata">

**Author:** ![sahadevgd](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sahadevgd](https://discuss.elastic.co/u/sahadevgd)\
**Post date:** [March 26, 2018, 7:28am UTC](https://discuss.elastic.co/t/the-final-mapping-would-have-more-than-1-type-error-intermittent/125370/3 "2018-03-26T07:28:02Z")

</div>

thanks for the response, I'll check on that!

---

<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:** [April 23, 2018, 7:28am UTC](https://discuss.elastic.co/t/the-final-mapping-would-have-more-than-1-type-error-intermittent/125370/4 "2018-04-23T07:28:03Z")

</div>

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