# Reuse of mappings

**URL:** https://discuss.elastic.co/t/reuse-of-mappings/39516
**Category:** Elasticsearch
**Created:** [January 19, 2016, 9:04am UTC](https://discuss.elastic.co/t/reuse-of-mappings/39516 "2016-01-19T09:04:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bryan\_rasmussen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_rasmussen/32/874_2.png) [@bryan\_rasmussen](https://discuss.elastic.co/u/bryan_rasmussen)
#### Post date: [January 19, 2016, 9:04am UTC](https://discuss.elastic.co/t/reuse-of-mappings/39516/1 "2016-01-19T09:04:48Z")

</div>

I have a couple of types of documents that are essentially the same - so as I read this  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html)

```
Fields with:
the same name

in the same index

in different mapping types

map to the same field internally,

and must have the same mapping.

```

if it's inside the same index I don't actually have to define a mapping for a field with the name 'name' under document type active\_product if there is already a definition of a field with that name under type product because it will be given the same mapping by elasticsearch automatically.

Correct?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 19, 2016, 9:11am UTC](https://discuss.elastic.co/t/reuse-of-mappings/39516/2 "2016-01-19T09:11:45Z")

</div>

Depends how you defined the original mapping, if you created it against a single type then it won't work.

---

<div class="post-metadata">

### Author: ![bryan\_rasmussen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bryan_rasmussen/32/874_2.png) [@bryan\_rasmussen](https://discuss.elastic.co/u/bryan_rasmussen)
#### Post date: [January 19, 2016, 9:21am UTC](https://discuss.elastic.co/t/reuse-of-mappings/39516/3 "2016-01-19T09:21:53Z")

</div>

ok well if I have

```
"mappings": {
    "product" : {
        "properties" : {
            "currency" : {"type" : "string", "index": "not_analyzed"},

```

and then I create a new document type "active\_product" in the same index do I have to do a mapping for a currency field for that document type or will it just map active.product currency the same way that product currency is mapped ( if not is there a way to specify that this type inherits all of this types mappings plus defines it's own)?

---

<div class="post-metadata">

### Author: ![guilherme\_maranhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guilherme_maranhao/32/101483_2.png) [@guilherme\_maranhao](https://discuss.elastic.co/u/guilherme_maranhao)
#### Post date: [January 6, 2017, 8:09pm UTC](https://discuss.elastic.co/t/reuse-of-mappings/39516/4 "2017-01-06T20:09:05Z")

</div>

Hi Bryan,

I'm facing the same issue in my index mapping. How did you solve it? I know I've read something about it in 2.3 version, but I can't find any docs related to it in 5.0.

Thank you,

Guilherme

---

<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 5, 2017, 10:04pm UTC](https://discuss.elastic.co/t/reuse-of-mappings/39516/5 "2017-07-05T22:04:25Z")

</div>


