# Rejecting mapping update to \[test-index\] as the final mapping would have more than 1 type: \[\_doc, products\]

**URL:** https://discuss.elastic.co/t/rejecting-mapping-update-to-test-index-as-the-final-mapping-would-have-more-than-1-type-doc-products/219282
**Category:** Elasticsearch
**Created:** [February 13, 2020, 9:12pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-index-as-the-final-mapping-would-have-more-than-1-type-doc-products/219282 "2020-02-13T21:12:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)
#### Post date: [February 13, 2020, 9:12pm UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-index-as-the-final-mapping-would-have-more-than-1-type-doc-products/219282/1 "2020-02-13T21:12:46Z")

</div>

Hi, I'm working on migrating my elasticsearch 2.4 to the latest version 7.5.

Due to removal of mapping types in the elasticsearch 6.0, I was earlier using multiple types in a single index.

Now, I've defined my mappings like this:

```auto
"test-index: {
    "mappings": {
        "properties": {
            // custom type field - category
           "category": {
               "properties": {
                      // definitions
                } 
           },
           "products": {
                "properties": {
                     // definitions
                 }
            },
        }
    }
}

```

So, in this way in a single index, I'm trying to store multiple types. This does not give me any error and output is a success.

But, when I try to populate the data in the index during bulk indexing, it throws this error:

```auto
Rejecting mapping update to [test-index] as the final mapping would have more than 1 type: [_doc, category]

Rejecting mapping update to [test-index] as the final mapping would have more than 1 type: [_doc, products]

```

Why is this happening? It would be great if anyone can help me fix this out.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [February 14, 2020, 9:30am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-index-as-the-final-mapping-would-have-more-than-1-type-doc-products/219282/2 "2020-02-14T09:30:06Z")

</div>

the mapping itself looks fine, however without the URLs specified that you call, it is impossible to tell if that requests is valid.

What basically happens is, that `_doc` is the default type, but somewhere in your mapping update calls or index templates, there is a reference to the category or products type.

If this should be debugged further, a minimal working example includes all URLs, request bodies, index creation calls, index templates up to that error message is needed.

---

<div class="post-metadata">

### Author: ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)
#### Post date: [February 16, 2020, 10:29am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-index-as-the-final-mapping-would-have-more-than-1-type-doc-products/219282/3 "2020-02-16T10:29:41Z")

</div>

Hi Alexander, I debugged my program and found that mapping was correct but the method which I was using for bulk indexing was having an another method `Type`, which is already deprecated in the latest version of ES. I've removed it, and it seems to work perfect now.

Thank you for the help, I really appreciate it. 🙂

---

<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 15, 2020, 10:29am UTC](https://discuss.elastic.co/t/rejecting-mapping-update-to-test-index-as-the-final-mapping-would-have-more-than-1-type-doc-products/219282/4 "2020-03-15T10:29:51Z")

</div>

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