# Mapping Clarification

**URL:** <https://discuss.elastic.co/t/mapping-clarification/2865>\
**Category:** Elasticsearch\
**Created:** [March 24, 2010, 6:52pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865 "2010-03-24T18:52:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_2](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Matt\_2](https://discuss.elastic.co/u/Matt_2)\
**Post date:** [March 24, 2010, 6:52pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865/1 "2010-03-24T18:52:38Z")

</div>

I'd like to create a new index on some time interval (day or week)  
where all indexes have the same format, in order to grow the total  
number of shards over time and allow for the total number of servers  
in the cluster to grow over time. This happens nicely and  
automatically if I just add a date stamp to my index name and continue  
indexing records as I get them. Is there a way to define a mapping  
that will be inherited by indexes that are created automatically by  
Elastic Search?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 24, 2010, 7:00pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865/2 "2010-03-24T19:00:48Z")

</div>

There isn't an option to do that currently, the ability for an index created  
to automatically get a set of mappings applied to it. Open an issue for it,  
should be simple to implement 🙂

-shay.banon

On Wed, Mar 24, 2010 at 8:52 PM, Matt [matthew.maul@gmail.com](mailto:matthew.maul@gmail.com) wrote:

> I'd like to create a new index on some time interval (day or week)  
> where all indexes have the same format, in order to grow the total  
> number of shards over time and allow for the total number of servers  
> in the cluster to grow over time. This happens nicely and  
> automatically if I just add a date stamp to my index name and continue  
> indexing records as I get them. Is there a way to define a mapping  
> that will be inherited by indexes that are created automatically by  
> Elastic Search?

---

<div class="post-metadata">

**Author:** ![Matt\_2](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Matt\_2](https://discuss.elastic.co/u/Matt_2)\
**Post date:** [March 24, 2010, 7:14pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865/3 "2010-03-24T19:14:20Z")

</div>

Great. My thought was that something like:

curl -XPUT [http://localhost:9200/\_all/object\_name/\_mapping](http://localhost:9200/_all/object_name/_mapping) -d pay\_load

would apply the mapping to current indexes, as well as future indexes.  
Does that make sense? Should I phrase the issue as an enhancement to  
multi-index mapping, or a totally new feature?

On Mar 24, 3:00 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> There isn't an option to do that currently, the ability for an index created  
> to automatically get a set of mappings applied to it. Open an issue for it,  
> should be simple to implement 🙂
> 
> -shay.banon
> 
> On Wed, Mar 24, 2010 at 8:52 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com) wrote:
> 
> > I'd like to create a new index on some time interval (day or week)  
> > where all indexes have the same format, in order to grow the total  
> > number of shards over time and allow for the total number of servers  
> > in the cluster to grow over time. This happens nicely and  
> > automatically if I just add a date stamp to my index name and continue  
> > indexing records as I get them. Is there a way to define a mapping  
> > that will be inherited by indexes that are created automatically by  
> > Elastic Search?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 24, 2010, 8:03pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865/4 "2010-03-24T20:03:51Z")

</div>

Actually, thats a great idea, I did not think about exposing it as an API,  
but allowing to specify a list of mappings to load when started. Yours is  
much better. Just create an issue as a new feature.

I need to think about the syntax though, since you can already do \_all,  
which applies it to the current indices (and not future ones, as its not  
implemented yet 🙂 ).

-shay.banon

On Wed, Mar 24, 2010 at 9:14 PM, Matt [matthew.maul@gmail.com](mailto:matthew.maul@gmail.com) wrote:

> Great. My thought was that something like:
> 
> curl -XPUT [http://localhost:9200/\_all/object\_name/\_mapping](http://localhost:9200/_all/object_name/_mapping) -d pay\_load
> 
> would apply the mapping to current indexes, as well as future indexes.  
> Does that make sense? Should I phrase the issue as an enhancement to  
> multi-index mapping, or a totally new feature?
> 
> On Mar 24, 3:00 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > There isn't an option to do that currently, the ability for an index  
> > created  
> > to automatically get a set of mappings applied to it. Open an issue for  
> > it,  
> > should be simple to implement 🙂
> > 
> > -shay.banon
> > 
> > On Wed, Mar 24, 2010 at 8:52 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com) wrote:
> > 
> > > I'd like to create a new index on some time interval (day or week)  
> > > where all indexes have the same format, in order to grow the total  
> > > number of shards over time and allow for the total number of servers  
> > > in the cluster to grow over time. This happens nicely and  
> > > automatically if I just add a date stamp to my index name and continue  
> > > indexing records as I get them. Is there a way to define a mapping  
> > > that will be inherited by indexes that are created automatically by  
> > > Elastic Search?

---

<div class="post-metadata">

**Author:** ![Matt\_2](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Matt\_2](https://discuss.elastic.co/u/Matt_2)\
**Post date:** [March 24, 2010, 8:20pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865/5 "2010-03-24T20:20:24Z")

</div>

Your way would be nice too. If I could store my mappings in a config  
file and have them apply to all future indexes, I wouldn't have to  
clutter my application code at all; the mappings would just be picked  
up by the cluster at start-up time. As an API, it's sort of an extra  
manual task when you boot a cluster to define the mappings, but it  
would allow for adding a new type of object to a growing set of  
indices. Maybe I'll create a ticket for each and let you decide what's  
a better idea.

On Mar 24, 4:03 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Actually, thats a great idea, I did not think about exposing it as an API,  
> but allowing to specify a list of mappings to load when started. Yours is  
> much better. Just create an issue as a new feature.
> 
> I need to think about the syntax though, since you can already do \_all,  
> which applies it to the current indices (and not future ones, as its not  
> implemented yet 🙂 ).
> 
> -shay.banon
> 
> On Wed, Mar 24, 2010 at 9:14 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com) wrote:
> 
> > Great. My thought was that something like:
> 
> > curl -XPUThttp://localhost:9200/\_all/object\_name/\_mapping-d pay\_load
> 
> > would apply the mapping to current indexes, as well as future indexes.  
> > Does that make sense? Should I phrase the issue as an enhancement to  
> > multi-index mapping, or a totally new feature?
> 
> > On Mar 24, 3:00 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > There isn't an option to do that currently, the ability for an index  
> > > created  
> > > to automatically get a set of mappings applied to it. Open an issue for  
> > > it,  
> > > should be simple to implement 🙂
> 
> > > -shay.banon
> 
> > > On Wed, Mar 24, 2010 at 8:52 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com) wrote:
> > > 
> > > > I'd like to create a new index on some time interval (day or week)  
> > > > where all indexes have the same format, in order to grow the total  
> > > > number of shards over time and allow for the total number of servers  
> > > > in the cluster to grow over time. This happens nicely and  
> > > > automatically if I just add a date stamp to my index name and continue  
> > > > indexing records as I get them. Is there a way to define a mapping  
> > > > that will be inherited by indexes that are created automatically by  
> > > > Elastic Search?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [March 24, 2010, 9:28pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865/6 "2010-03-24T21:28:19Z")

</div>

cool, I will try and work on it soon.

-shay.banon

On Wed, Mar 24, 2010 at 10:20 PM, Matt [matthew.maul@gmail.com](mailto:matthew.maul@gmail.com) wrote:

> Your way would be nice too. If I could store my mappings in a config  
> file and have them apply to all future indexes, I wouldn't have to  
> clutter my application code at all; the mappings would just be picked  
> up by the cluster at start-up time. As an API, it's sort of an extra  
> manual task when you boot a cluster to define the mappings, but it  
> would allow for adding a new type of object to a growing set of  
> indices. Maybe I'll create a ticket for each and let you decide what's  
> a better idea.
> 
> On Mar 24, 4:03 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Actually, thats a great idea, I did not think about exposing it as an  
> > API,  
> > but allowing to specify a list of mappings to load when started. Yours is  
> > much better. Just create an issue as a new feature.
> > 
> > I need to think about the syntax though, since you can already do \_all,  
> > which applies it to the current indices (and not future ones, as its not  
> > implemented yet 🙂 ).
> > 
> > -shay.banon
> > 
> > On Wed, Mar 24, 2010 at 9:14 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com) wrote:
> > 
> > > Great. My thought was that something like:
> > 
> > > curl -XPUThttp://localhost:9200/\_all/object\_name/\_mapping-d pay\_load
> > 
> > > would apply the mapping to current indexes, as well as future indexes.  
> > > Does that make sense? Should I phrase the issue as an enhancement to  
> > > multi-index mapping, or a totally new feature?
> > 
> > > On Mar 24, 3:00 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > 
> > > > There isn't an option to do that currently, the ability for an index  
> > > > created  
> > > > to automatically get a set of mappings applied to it. Open an issue  
> > > > for  
> > > > it,  
> > > > should be simple to implement 🙂
> > 
> > > > -shay.banon
> > 
> > > > On Wed, Mar 24, 2010 at 8:52 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com)  
> > > > wrote:
> > > > 
> > > > > I'd like to create a new index on some time interval (day or week)  
> > > > > where all indexes have the same format, in order to grow the total  
> > > > > number of shards over time and allow for the total number of  
> > > > > servers  
> > > > > in the cluster to grow over time. This happens nicely and  
> > > > > automatically if I just add a date stamp to my index name and  
> > > > > continue  
> > > > > indexing records as I get them. Is there a way to define a mapping  
> > > > > that will be inherited by indexes that are created automatically by  
> > > > > Elastic Search?

---

<div class="post-metadata">

**Author:** ![Matt\_2](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Matt\_2](https://discuss.elastic.co/u/Matt_2)\
**Post date:** [March 24, 2010, 9:48pm UTC](https://discuss.elastic.co/t/mapping-clarification/2865/7 "2010-03-24T21:48:52Z")

</div>

Awesome. Thanks for being so quick to respond.

On Mar 24, 5:28 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> cool, I will try and work on it soon.
> 
> -shay.banon
> 
> On Wed, Mar 24, 2010 at 10:20 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com) wrote:
> 
> > Your way would be nice too. If I could store my mappings in a config  
> > file and have them apply to all future indexes, I wouldn't have to  
> > clutter my application code at all; the mappings would just be picked  
> > up by the cluster at start-up time. As an API, it's sort of an extra  
> > manual task when you boot a cluster to define the mappings, but it  
> > would allow for adding a new type of object to a growing set of  
> > indices. Maybe I'll create a ticket for each and let you decide what's  
> > a better idea.
> 
> > On Mar 24, 4:03 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > Actually, thats a great idea, I did not think about exposing it as an  
> > > API,  
> > > but allowing to specify a list of mappings to load when started. Yours is  
> > > much better. Just create an issue as a new feature.
> 
> > > I need to think about the syntax though, since you can already do \_all,  
> > > which applies it to the current indices (and not future ones, as its not  
> > > implemented yet 🙂 ).
> 
> > > -shay.banon
> 
> > > On Wed, Mar 24, 2010 at 9:14 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com) wrote:
> > > 
> > > > Great. My thought was that something like:
> 
> > > > curl -XPUThttp://localhost:9200/\_all/object\_name/\_mapping-dpay\_load
> 
> > > > would apply the mapping to current indexes, as well as future indexes.  
> > > > Does that make sense? Should I phrase the issue as an enhancement to  
> > > > multi-index mapping, or a totally new feature?
> 
> > > > On Mar 24, 3:00 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > > > 
> > > > > There isn't an option to do that currently, the ability for an index  
> > > > > created  
> > > > > to automatically get a set of mappings applied to it. Open an issue  
> > > > > for  
> > > > > it,  
> > > > > should be simple to implement 🙂
> 
> > > > > -shay.banon
> 
> > > > > On Wed, Mar 24, 2010 at 8:52 PM, Matt [matthew.m...@gmail.com](mailto:matthew.m...@gmail.com)  
> > > > > wrote:
> > > > > 
> > > > > > I'd like to create a new index on some time interval (day or week)  
> > > > > > where all indexes have the same format, in order to grow the total  
> > > > > > number of shards over time and allow for the total number of  
> > > > > > servers  
> > > > > > in the cluster to grow over time. This happens nicely and  
> > > > > > automatically if I just add a date stamp to my index name and  
> > > > > > continue  
> > > > > > indexing records as I get them. Is there a way to define a mapping  
> > > > > > that will be inherited by indexes that are created automatically by  
> > > > > > Elastic Search?

---

<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, 4:25am UTC](https://discuss.elastic.co/t/mapping-clarification/2865/8 "2017-07-06T04:25:06Z")

</div>


