# Rollup job failed to create due to inal mapping would have more than 1 type: \[\_doc, doc\]"

**URL:** https://discuss.elastic.co/t/rollup-job-failed-to-create-due-to-inal-mapping-would-have-more-than-1-type-doc-doc/144305
**Category:** Elasticsearch
**Created:** [August 14, 2018, 8:59am UTC](https://discuss.elastic.co/t/rollup-job-failed-to-create-due-to-inal-mapping-would-have-more-than-1-type-doc-doc/144305 "2018-08-14T08:59:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Yoav\_Sharon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yoav_sharon/32/34458_2.png) [@Yoav\_Sharon](https://discuss.elastic.co/u/Yoav_Sharon)
#### Post date: [August 14, 2018, 8:59am UTC](https://discuss.elastic.co/t/rollup-job-failed-to-create-due-to-inal-mapping-would-have-more-than-1-type-doc-doc/144305/1 "2018-08-14T08:59:19Z")

</div>

Hi,  
i'm trying to create a rollup job. the return result is fail due to "final mapping would have more than 1 type: [\_doc, doc]""  
my mapping template is attached:  
put \_template/defualt  
{  
"order": 0,  
"index\_patterns": [  
"vlte\*","vr\*","vnm\*","Node\*"  
],  
"settings": {  
"index": {  
"mapping": {  
"total\_fields": {  
"limit": "1600"  
}  
},  
"refresh\_interval": "5s",  
"number\_of\_shards": "3",  
"number\_of\_replicas": "1"  
}  
},  
"mappings": {  
"doc": {  
"properties": {  
"DateAndTimeEnd": {  
"type": "date",  
"format": "yyyy-MM-dd HH:mm:ss"  
},  
"DateAndTimeStart": {  
"type": "date",  
"format": "yyyy-MM-dd HH:mm:ss"  
}  
}  
}  
}  
}  
i've read the new type handling but can't figure out what is missing

---

<div class="post-metadata">

### Author: ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)
#### Post date: [August 21, 2018, 9:47pm UTC](https://discuss.elastic.co/t/rollup-job-failed-to-create-due-to-inal-mapping-would-have-more-than-1-type-doc-doc/144305/2 "2018-08-21T21:47:44Z")

</div>

Hey @Yoav_Sharon, sorry for the delay in answering this!

I believe what's happening is that your index template is also matching the destination rollup index. Internally Rollup uses `"_doc"` for the type name (it's hardcoded), and your template uses `"doc"`. So when Rollup creates the destination index to store the results, it tries to create it with `_doc` but then the index template is applied with `doc` and it throws that exception about being more than one type.

Eventually this sort of thing will go away when types are removed entirely.

For now, the easiest thing to do is make sure the rollup destination indices _don't_ match your index template, or make sure your index templates use `_doc`.

BTW, `_doc` is the recommended doc type in the future because the various API URLs will use `_doc` where the type used to be specified. So it'll make upgrading easier.

---

<div class="post-metadata">

### Author: ![berg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/berg/32/14962_2.png) [@berg](https://discuss.elastic.co/u/berg)
#### Post date: [September 3, 2018, 3:41am UTC](https://discuss.elastic.co/t/rollup-job-failed-to-create-due-to-inal-mapping-would-have-more-than-1-type-doc-doc/144305/3 "2018-09-03T03:41:19Z")

</div>

@Yoav_Sharon I ran into this; the annoying thing about `_doc` is that the default `_type` for logstash elasticsearch output is... `doc`. 🙄  
[https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-document\_type](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-document_type)

> - for elasticsearch clusters 6.x and above: the value of _doc_ will be used;

You can imagine the annoying process of trying to write logstash config to manage the process of migrating from `doc` the logstash default to `_doc` the elasticsearch default, when you have indices being created on weekly, monthly and yearly patterns. I have to wait until a month starting on Monday swings around to do this in a one step process. As you point out, it's not the end of the world to create the rollup target indices outside of your existing index templates scope, just an annoying problem to work around.

I built my ES template off the logstash default and missed this being different from the ES default. I guess that learns me for not thinking about this better during the ES6 upgrade cycle 😆

---

<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: [October 1, 2018, 3:41am UTC](https://discuss.elastic.co/t/rollup-job-failed-to-create-due-to-inal-mapping-would-have-more-than-1-type-doc-doc/144305/4 "2018-10-01T03:41:25Z")

</div>

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