# Rejecting mapping update ... as the final mapping would have more than 1 type

**URL:** https://discuss.elastic.co/t/rejecting-mapping-update-as-the-final-mapping-would-have-more-than-1-type/122593
**Category:** Elasticsearch
**Created:** [March 5, 2018, 8:39pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-as-the-final-mapping-would-have-more-than-1-type/122593 "2018-03-05T20:39:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![davehatma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davehatma/32/29322_2.png) [@davehatma](https://discuss.elastic.co/u/davehatma)
#### Post date: [March 5, 2018, 8:39pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-as-the-final-mapping-would-have-more-than-1-type/122593/1 "2018-03-05T20:39:07Z")

</div>

I have a brand new ES Docker container running with no indexes or index templates. I PUT a new mapping template for some metrics indexes I want to load and get a 200OK. However, when I try to update ES from LogStash, I get the following:

"Rejecting mapping update to [pymsa\_metrics:2018-03-05] as the final mapping would have more than 1 type: [pymsa\_metrics, doc]"

Here is my mapping template:  
{  
"order": 0,  
"index\_patterns": [  
"pymsa\_metrics:\*"  
],  
"settings": {  
"index": {  
"number\_of\_shards": "1"  
}  
},  
"mappings": {  
"entry": {  
"properties": {  
"application\_name": {  
"type": "keyword"  
},  
"application\_type": {  
"type": "keyword"  
},  
"container\_id": {  
"type": "keyword"  
},  
"correlation\_id": {  
"type": "keyword"  
},  
"elapsed": {  
"type": "integer"  
},  
"hh": {  
"type": "integer"  
},  
"hh:mm": {  
"type": "keyword"  
},  
"log\_type": {  
"type": "keyword"  
},  
"method": {  
"type": "keyword"  
},  
"mm": {  
"type": "integer"  
},  
"module": {  
"type": "keyword"  
}  
}  
}  
},  
"aliases": {}  
}

I've researched to the point where I need to make this post. (I tried to get the mapping text to format better using the supplied toolbar, but alas, I could not).

Any help will be greatly appreciated.

Thanks,

Dave

---

<div class="post-metadata">

### Author: ![Sjaak01](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Sjaak01](https://discuss.elastic.co/u/Sjaak01)
#### Post date: [March 6, 2018, 7:31am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-as-the-final-mapping-would-have-more-than-1-type/122593/2 "2018-03-06T07:31:09Z")

</div>

As of 6.x you can't have multiple types anymore. Try something like this:

```auto
{
  "template_name": {
    "order": 0,
    "index_patterns": [
      "index-pattern-*"
    ],
    "settings": {
      "index": {
        "number_of_shards": "1",
        "number_of_replicas": "0"
      }
    },
    "mappings": {
      "doc": {
        "properties": {
          "@ingest_time": {
            "type": "date"
          }
```

Now if you need a type field to match with the type field you might have in your log files you can simply add:

```auto
          "type": {
            "type": "keyword",
            "ignore_above": 256
```

---

<div class="post-metadata">

### Author: ![davehatma](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davehatma/32/29322_2.png) [@davehatma](https://discuss.elastic.co/u/davehatma)
#### Post date: [March 6, 2018, 1:51pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-as-the-final-mapping-would-have-more-than-1-type/122593/3 "2018-03-06T13:51:26Z")

</div>

Sjaak,

Thanks for responding. Please forgive, but I'm not following.... I understand that multiple types for an index is being deprecated and not allowed for new indexes in V6+. However, I am at a loss at to seeing where I am referencing two index types in my mappings config. The error message says I'm trying to do a "pymsa\_metrics" AND "doc" types for the index, but I just don't see how that can be. I have followed the example here -- [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html) -- as a template, substituting my own values for the index and the fields. The only place I can see in my config that references "type" is in the properties object of the mappings entries.

Would you be able to point out where in MY config I am making the error?

Thanks,

Dave

---

<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 3, 2018, 1:51pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-as-the-final-mapping-would-have-more-than-1-type/122593/4 "2018-04-03T13:51:31Z")

</div>

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