# Simple "Mappings" section throws error

**URL:** https://discuss.elastic.co/t/simple-mappings-section-throws-error/122809
**Category:** Kibana
**Created:** [March 7, 2018, 3:18am UTC](https://discuss.elastic.co/t/simple-mappings-section-throws-error/122809 "2018-03-07T03:18:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jason\_smith](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jason\_smith](https://discuss.elastic.co/u/jason_smith)
#### Post date: [March 7, 2018, 3:18am UTC](https://discuss.elastic.co/t/simple-mappings-section-throws-error/122809/1 "2018-03-07T03:18:39Z")

</div>

Hello folks

I am typing a structure for an index. I am getting  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "Rejecting mapping update to [animals] as the final mapping would have more than 1 type: [carnivore, herbivore]"  
}

```
        PUT /animals/_mapping/carnivore
        {
                    "properties": {
                    "name": 
                     {
                                     "type": "text",
                                     "analyzer": "standard"
                    }
                  }
         }
        PUT /animals/_mapping/herbivore
        {
                 "properties": {
                             "name": 
                             {
                                           "type": "text",
                                          "analyzer": "standard"
                              }
                   }
        }
```

---

<div class="post-metadata">

### Author: ![jbudz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jbudz/32/45922_2.png) [@jbudz](https://discuss.elastic.co/u/jbudz)
#### Post date: [March 7, 2018, 3:44pm UTC](https://discuss.elastic.co/t/simple-mappings-section-throws-error/122809/2 "2018-03-07T15:44:46Z")

</div>

As of Elasticsearch 6.0 indices with more than one type are nor allowed. Long term the \_type field is going away. The error is saying we have one type, carnivore, and now we're trying to add a new type called herbivore. Are you following this from a guide? Maybe we can get it updated.

There's several options for resolving.

Add a type field with each document, that becomes herbivore or carnivore:

```auto
PUT /animals/_mapping/doc
{
  "properties": {
    "name": {
      "type": "text",
      "analyzer": "standard"
    },
    "type": {
       "type": "keyword"
    }
  }
}

```

Alternatively, separate indices for each type:

```auto
PUT /herbivore/_mapping/doc
{
  "properties": {
    "name": {
      "type": "text",
      "analyzer": "standard"
    }
  }
}

PUT /carnivore/_mapping/doc
{
  "properties": {
    "name": {
      "type": "text",
      "analyzer": "standard"
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![jason\_smith](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@jason\_smith](https://discuss.elastic.co/u/jason_smith)
#### Post date: [March 7, 2018, 5:34pm UTC](https://discuss.elastic.co/t/simple-mappings-section-throws-error/122809/3 "2018-03-07T17:34:43Z")

</div>

Ok got it. For one "index" (equivalent to "database" in RDBMS world) we can have only one "type".  
This change is from Elasticsearch 6.0

No I didn't try this from Elastic guide. I tried it from a sample from some other site. Looks like that sample is from older version of Elasticsearch version.

Thank You very much

---

<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 4, 2018, 5:34pm UTC](https://discuss.elastic.co/t/simple-mappings-section-throws-error/122809/4 "2018-04-04T17:34:44Z")

</div>

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