# Is it possible for document mappings to be inherited

**URL:** https://discuss.elastic.co/t/is-it-possible-for-document-mappings-to-be-inherited/17643
**Category:** Elasticsearch
**Created:** [May 21, 2014, 11:30am UTC](https://discuss.elastic.co/t/is-it-possible-for-document-mappings-to-be-inherited/17643 "2014-05-21T11:30:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Ben\_George](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@Ben\_George](https://discuss.elastic.co/u/Ben_George)
#### Post date: [May 21, 2014, 11:30am UTC](https://discuss.elastic.co/t/is-it-possible-for-document-mappings-to-be-inherited/17643/1 "2014-05-21T11:30:08Z")

</div>

I have a document type with some complicated field mappings, and another  
with same mappings plus one extra field.

So question: is there a way to inherit field mappings ? What options do I  
have so I don't copy paste field mappings into each document type ?

--  
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/29779130-01cb-4862-8212-41bd761db71a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/29779130-01cb-4862-8212-41bd761db71a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ben\_George](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@Ben\_George](https://discuss.elastic.co/u/Ben_George)
#### Post date: [May 21, 2014, 12:01pm UTC](https://discuss.elastic.co/t/is-it-possible-for-document-mappings-to-be-inherited/17643/2 "2014-05-21T12:01:51Z")

</div>

This is similar to dynamic templates[http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates),  
except I want to match on type eg: "my\_type\*", so that my\_type and  
my\_type\_extra\_field get the same mappings.

On Wednesday, 21 May 2014 12:30:08 UTC+1, Ben George wrote:

> I have a document type with some complicated field mappings, and another  
> with same mappings plus one extra field.
> 
> So question: is there a way to inherit field mappings ? What options do I  
> have so I don't copy paste field mappings into each document type ?

--  
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/4e6c50e2-5215-4919-b4c6-3311c18764b4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4e6c50e2-5215-4919-b4c6-3311c18764b4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ben\_George](https://avatars.discourse-cdn.com/v4/letter/b/58956e/32.png) [@Ben\_George](https://discuss.elastic.co/u/Ben_George)
#### Post date: [May 21, 2014, 12:02pm UTC](https://discuss.elastic.co/t/is-it-possible-for-document-mappings-to-be-inherited/17643/3 "2014-05-21T12:02:46Z")

</div>

What I want to do is similar to dynamic templates[http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates),  
except I want to match on type eg: "my\_type\*", so that my\_type and  
my\_type\_extra\_field get the same field mappings.

On Wednesday, 21 May 2014 12:30:08 UTC+1, Ben George wrote:

> I have a document type with some complicated field mappings, and another  
> with same mappings plus one extra field.
> 
> So question: is there a way to inherit field mappings ? What options do I  
> have so I don't copy paste field mappings into each document type ?

--  
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/2673c1ca-f4dd-4080-b0d4-ce220f0d9167%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2673c1ca-f4dd-4080-b0d4-ce220f0d9167%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [May 22, 2014, 5:45pm UTC](https://discuss.elastic.co/t/is-it-possible-for-document-mappings-to-be-inherited/17643/4 "2014-05-22T17:45:37Z")

</div>

Look into index templates with ordering. You can perhaps achieve what you  
are looking for if you can restrict the match wildcard.

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--  
Ivan

On Wed, May 21, 2014 at 5:02 AM, Ben George [bengeorge@gmail.com](mailto:bengeorge@gmail.com) wrote:

> What I want to do is similar to dynamic templates[http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/custom-dynamic-mapping.html#dynamic-templates),  
> except I want to match on type eg: "my\_type\*", so that my\_type and  
> my\_type\_extra\_field get the same field mappings.
> 
> On Wednesday, 21 May 2014 12:30:08 UTC+1, Ben George wrote:
> 
> > I have a document type with some complicated field mappings, and another  
> > with same mappings plus one extra field.
> > 
> > So question: is there a way to inherit field mappings ? What options do  
> > I have so I don't copy paste field mappings into each document type ?
> 
> --  
> 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/2673c1ca-f4dd-4080-b0d4-ce220f0d9167%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2673c1ca-f4dd-4080-b0d4-ce220f0d9167%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/2673c1ca-f4dd-4080-b0d4-ce220f0d9167%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2673c1ca-f4dd-4080-b0d4-ce220f0d9167%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CALY%3DcQDqCFSr%3Dw-q1ssE8%2Bv5rNQisvcX\_q5sq-oG2sJqfNM2qA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQDqCFSr%3Dw-q1ssE8%2Bv5rNQisvcX_q5sq-oG2sJqfNM2qA%40mail.gmail.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, 1:27am UTC](https://discuss.elastic.co/t/is-it-possible-for-document-mappings-to-be-inherited/17643/5 "2017-07-06T01:27:35Z")

</div>


