# Mapping versioning by using doc\_type

**URL:** <https://discuss.elastic.co/t/mapping-versioning-by-using-doc-type/20087>\
**Category:** Elasticsearch\
**Created:** [October 6, 2014, 9:30am UTC](https://discuss.elastic.co/t/mapping-versioning-by-using-doc-type/20087 "2014-10-06T09:30:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Han\_JU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/han_ju/32/962_2.png) [@Han\_JU](https://discuss.elastic.co/u/Han_JU)\
**Post date:** [October 6, 2014, 9:30am UTC](https://discuss.elastic.co/t/mapping-versioning-by-using-doc-type/20087/1 "2014-10-06T09:30:37Z")

</div>

Hi,

We've constantly facing with updates/changes in our document mapping during  
development, so we've come up with a idea of using `doc_type` for  
versioning.  
Basically we start from a `doc_type` like: `thing_0` as the start point.  
And each time we have some changes in the mapping, we created a updated  
version of mapping and put it under a new `doc_type` like : `thing_1`. Then  
we switch all our systems to the new doc\_type `thing_1`.  
And asynchronously we migrate the data from old version, `thing_0`, to the  
new doc\_type `thing_1`, or simple delete them.

One thing remains a problem: asynchronously migration means that at some  
point, we may have multiple doc\_types in a single index (maybe 10+). Will  
this become a problem for ElasticSearch? (performance?)  
Otherwise, do you guys thinks it's a good idea for versioning document  
mappings? How do you handle changes in the mapping?

Thanks.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2408833a-b9bd-4875-9526-0d61ad215f33%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2408833a-b9bd-4875-9526-0d61ad215f33%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 12:58am UTC](https://discuss.elastic.co/t/mapping-versioning-by-using-doc-type/20087/2 "2017-07-06T00:58:08Z")

</div>


