# Using the \_mapping api

**URL:** <https://discuss.elastic.co/t/using-the--mapping-api/12701>\
**Category:** Elasticsearch\
**Created:** [July 8, 2013, 2:45pm UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701 "2013-07-08T14:45:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jettro\_Coenradie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jettro_coenradie/32/59704_2.png) [@Jettro\_Coenradie](https://discuss.elastic.co/u/Jettro_Coenradie)\
**Post date:** [July 8, 2013, 2:45pm UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/1 "2013-07-08T14:45:22Z")

</div>

Hi,  
I am using the \_mapping api to learn more about the fields I have in my  
mapping. One result seems weird to me when looking at the object returned.

[http://localhost:9200/gridshore/\_mapping?pretty](http://localhost:9200/gridshore/_mapping?pretty)

{  
gridshore: {  
blog: {  
properties: {  
...  
}  
}  
}  
}

[http://localhost:9200/gridshore/blog/\_mapping?pretty](http://localhost:9200/gridshore/blog/_mapping?pretty)

{  
blog: {  
properties: {  
...  
}  
}  
}

So the index is omitted from the result. Is there is reason to do this, or  
is it a bug?

thanks,  
Jettro

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [July 8, 2013, 5:02pm UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/2 "2013-07-08T17:02:22Z")

</div>

Hello Jettro,

I find this behavior pretty normal. Although different people have  
different opinions 🙂 Here are my thoughts on the subject:

The second command is for getting a specific mapping. The point isn't for  
you to see the full path, but only what you asked for, that's why it only  
shows you the name of the mapping you requested.

The first command will give you all the mappings (corresponding to all the  
types) of your index. It shows you the index name there because you need to  
know which mapping you're looking at. It might look obvious, that  
"gridshore" is the index name, because you requested it, but you can get  
mappings for all indices, for example:

curl localhost:9200/\_mapping?pretty

Or multiple indices and/or multiple types within them, like:

curl localhost:9200/test,test2/testmap1,testmap2/\_mapping?pretty

In which case you need the index name in the returning JSON. So I think the  
point is to have the index name only when you request multiple mappings -  
that is, when you're likely to need it.

Best regards,  
Radu

On Mon, Jul 8, 2013 at 5:45 PM, Jettro Coenradie \<[jettro.coenradie@gmail.com](mailto:jettro.coenradie@gmail.com)

> wrote:

> Hi,  
> I am using the \_mapping api to learn more about the fields I have in my  
> mapping. One result seems weird to me when looking at the object returned.
> 
> [http://localhost:9200/gridshore/\_mapping?pretty](http://localhost:9200/gridshore/_mapping?pretty)
> 
> {  
> gridshore: {  
> blog: {  
> properties: {  
> ...  
> }  
> }  
> }  
> }
> 
> [http://localhost:9200/gridshore/blog/\_mapping?pretty](http://localhost:9200/gridshore/blog/_mapping?pretty)
> 
> {  
> blog: {  
> properties: {  
> ...  
> }  
> }  
> }
> 
> So the index is omitted from the result. Is there is reason to do this, or  
> is it a bug?
> 
> thanks,  
> Jettro
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jettro\_Coenradie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jettro_coenradie/32/59704_2.png) [@Jettro\_Coenradie](https://discuss.elastic.co/u/Jettro_Coenradie)\
**Post date:** [July 9, 2013, 6:15am UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/3 "2013-07-09T06:15:19Z")

</div>

Hi Radu, thank you for your answer. I know there is more to it. But what if  
you do this:

[http://localhost:9200/\_all/blog-item/\_mapping?pretty](http://localhost:9200/_all/blog-item/_mapping?pretty)

Than you do not get back the index, so you get back the type without the  
index it belongs to. I am not sure, is it possible to create a type without  
an index and reuse the same type among indexes?

In any case, it just makes doing my generic stuff a bit harder, in the end  
I'll go around it.

regards Jettro

Op maandag 8 juli 2013 19:02:22 UTC+2 schreef Radu Gheorghe het volgende:

> Hello Jettro,
> 
> I find this behavior pretty normal. Although different people have  
> different opinions 🙂 Here are my thoughts on the subject:
> 
> The second command is for getting a specific mapping. The point isn't for  
> you to see the full path, but only what you asked for, that's why it only  
> shows you the name of the mapping you requested.
> 
> The first command will give you all the mappings (corresponding to all the  
> types) of your index. It shows you the index name there because you need to  
> know which mapping you're looking at. It might look obvious, that  
> "gridshore" is the index name, because you requested it, but you can get  
> mappings for all indices, for example:
> 
> curl localhost:9200/\_mapping?pretty
> 
> Or multiple indices and/or multiple types within them, like:
> 
> curl localhost:9200/test,test2/testmap1,testmap2/\_mapping?pretty
> 
> In which case you need the index name in the returning JSON. So I think  
> the point is to have the index name only when you request multiple mappings
> 
> - that is, when you're likely to need it.
> 
> Best regards,  
> Radu
> 
> On Mon, Jul 8, 2013 at 5:45 PM, Jettro Coenradie \<[jettro.c...@gmail.com](mailto:jettro.c...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi,  
> > I am using the \_mapping api to learn more about the fields I have in my  
> > mapping. One result seems weird to me when looking at the object returned.
> > 
> > [http://localhost:9200/gridshore/\_mapping?pretty](http://localhost:9200/gridshore/_mapping?pretty)
> > 
> > {  
> > gridshore: {  
> > blog: {  
> > properties: {  
> > ...  
> > }  
> > }  
> > }  
> > }
> > 
> > [http://localhost:9200/gridshore/blog/\_mapping?pretty](http://localhost:9200/gridshore/blog/_mapping?pretty)
> > 
> > {  
> > blog: {  
> > properties: {  
> > ...  
> > }  
> > }  
> > }
> > 
> > So the index is omitted from the result. Is there is reason to do this,  
> > or is it a bug?
> > 
> > thanks,  
> > Jettro
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [July 9, 2013, 6:56am UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/4 "2013-07-09T06:56:37Z")

</div>

Hi Jettro,

On Tue, Jul 9, 2013 at 9:15 AM, Jettro Coenradie \<[jettro.coenradie@gmail.com](mailto:jettro.coenradie@gmail.com)

> wrote:

> Hi Radu, thank you for your answer. I know there is more to it. But what  
> if you do this:
> 
> [http://localhost:9200/\_all/blog-item/\_mapping?pretty](http://localhost:9200/_all/blog-item/_mapping?pretty)

It seems to me that it will just return the first "blog-item" mapping it  
finds. For example, if you have two indices with this mapping, the command  
above will only return one of them. And you probably wouldn't know which  
index it comes from.

> Than you do not get back the index, so you get back the type without the  
> index it belongs to. I am not sure, is it possible to create a type without  
> an index and reuse the same type among indexes?

No, you can't create a type without an index. But you can use templates  
where you can automatically create the same mappings to all new indices  
that match the template pattern:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

> In any case, it just makes doing my generic stuff a bit harder, in the end  
> I'll go around it.

Can you share what is the generic stuff you're trying to do here?

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jettro\_Coenradie\_2](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@Jettro\_Coenradie\_2](https://discuss.elastic.co/u/Jettro_Coenradie_2)\
**Post date:** [July 9, 2013, 8:31am UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/5 "2013-07-09T08:31:10Z")

</div>

I am working on a plugin:

> **[GitHub - jettro/elasticsearch-gui: An angularJS client for elasticsearch as a...](https://github.com/jettro/elasticsearch-gui)**
>
> An angularJS client for elasticsearch as a plugin. Contribute to jettro/elasticsearch-gui development by creating an account on GitHub.

> **[Elasticsearch gui](http://www.gridshore.nl/esgui/#/home)**
>
> Website for looking at elasticsearch data

At the moment I am thinking about a better way to present a dropdown with  
all possible fields. I want to limit the fields based on prior selected  
index(es) or type(s). It would be nice if the result of the following type  
of queries would have the same structure:

[http://localhost:9200/\_mapping](http://localhost:9200/_mapping)  
[http://localhost:9200/index\_a/\_mapping](http://localhost:9200/index_a/_mapping)  
[http://localhost:9200/index\_a,index\_b/\_mapping](http://localhost:9200/index_a,index_b/_mapping)  
[http://localhost:9200/index\_a/type\_a/\_mapping](http://localhost:9200/index_a/type_a/_mapping)  
[http://localhost:9200/index\_a/type\_a,type\_b/\_mapping](http://localhost:9200/index_a/type_a,type_b/_mapping)  
[http://localhost:9200/\*/type\_a/\_mapping](http://localhost:9200/*/type_a/_mapping)  
[http://localhost:9200/\_all/type\_a/\_mapping](http://localhost:9200/_all/type_a/_mapping)

On Tue, Jul 9, 2013 at 8:56 AM, Radu Gheorghe [radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com)wrote:

> Hi Jettro,
> 
> On Tue, Jul 9, 2013 at 9:15 AM, Jettro Coenradie \<  
> [jettro.coenradie@gmail.com](mailto:jettro.coenradie@gmail.com)\> wrote:
> 
> > Hi Radu, thank you for your answer. I know there is more to it. But what  
> > if you do this:
> > 
> > [http://localhost:9200/\_all/blog-item/\_mapping?pretty](http://localhost:9200/_all/blog-item/_mapping?pretty)
> 
> It seems to me that it will just return the first "blog-item" mapping it  
> finds. For example, if you have two indices with this mapping, the command  
> above will only return one of them. And you probably wouldn't know which  
> index it comes from.
> 
> > Than you do not get back the index, so you get back the type without the  
> > index it belongs to. I am not sure, is it possible to create a type without  
> > an index and reuse the same type among indexes?
> 
> No, you can't create a type without an index. But you can use templates  
> where you can automatically create the same mappings to all new indices  
> that match the template pattern:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/)
> 
> > In any case, it just makes doing my generic stuff a bit harder, in the  
> > end I'll go around it.
> 
> Can you share what is the generic stuff you're trying to do here?
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe](https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Jettro Coenradie

> **[Gridshore](https://www.gridshore.nl/)**
>
> A weblog about software engineering, Architecture, Technology an other things we like.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [July 9, 2013, 8:38am UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/6 "2013-07-09T08:38:40Z")

</div>

Ah, I see now. I see that this one _does_ show you indices:

curl localhost:9200/\*/a/\_mapping?pretty

Anyway, I understand the problem now. Maybe an option is to just open an  
issue and maybe they'll make it more consistent.

By the way, the UI shapes up really nice 🙂

On Tue, Jul 9, 2013 at 11:31 AM, Jettro Coenradie \<  
jettro.coenradie@gridshore.nl\> wrote:

> I am working on a plugin:  
> [GitHub - jettro/elasticsearch-gui: An angularJS client for elasticsearch as a plugin](https://github.com/jettro/elasticsearch-gui)  
> [Elasticsearch gui](http://www.gridshore.nl/esgui/#/home)
> 
> At the moment I am thinking about a better way to present a dropdown with  
> all possible fields. I want to limit the fields based on prior selected  
> index(es) or type(s). It would be nice if the result of the following type  
> of queries would have the same structure:
> 
> [http://localhost:9200/\_mapping](http://localhost:9200/_mapping)  
> [http://localhost:9200/index\_a/\_mapping](http://localhost:9200/index_a/_mapping)  
> [http://localhost:9200/index\_a,index\_b/\_mapping](http://localhost:9200/index_a,index_b/_mapping)  
> [http://localhost:9200/index\_a/type\_a/\_mapping](http://localhost:9200/index_a/type_a/_mapping)  
> [http://localhost:9200/index\_a/type\_a,type\_b/\_mapping](http://localhost:9200/index_a/type_a,type_b/_mapping)  
> [http://localhost:9200/\*/type\_a/\_mapping](http://localhost:9200/*/type_a/_mapping)  
> [http://localhost:9200/\_all/type\_a/\_mapping](http://localhost:9200/_all/type_a/_mapping)
> 
> On Tue, Jul 9, 2013 at 8:56 AM, Radu Gheorghe [radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com)wrote:
> 
> > Hi Jettro,
> > 
> > On Tue, Jul 9, 2013 at 9:15 AM, Jettro Coenradie \<  
> > [jettro.coenradie@gmail.com](mailto:jettro.coenradie@gmail.com)\> wrote:
> > 
> > > Hi Radu, thank you for your answer. I know there is more to it. But what  
> > > if you do this:
> > > 
> > > [http://localhost:9200/\_all/blog-item/\_mapping?pretty](http://localhost:9200/_all/blog-item/_mapping?pretty)
> > 
> > It seems to me that it will just return the first "blog-item" mapping it  
> > finds. For example, if you have two indices with this mapping, the command  
> > above will only return one of them. And you probably wouldn't know which  
> > index it comes from.
> > 
> > > Than you do not get back the index, so you get back the type without the  
> > > index it belongs to. I am not sure, is it possible to create a type without  
> > > an index and reuse the same type among indexes?
> > 
> > No, you can't create a type without an index. But you can use templates  
> > where you can automatically create the same mappings to all new indices  
> > that match the template pattern:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/)
> > 
> > > In any case, it just makes doing my generic stuff a bit harder, in the  
> > > end I'll go around it.
> > 
> > Can you share what is the generic stuff you're trying to do here?
> > 
> > ## Best regards, Radu
> > 
> > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe](https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Jettro Coenradie  
> [http://www.gridshore.nl](http://www.gridshore.nl)
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Jettro\_Coenradie\_2](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@Jettro\_Coenradie\_2](https://discuss.elastic.co/u/Jettro_Coenradie_2)\
**Post date:** [July 9, 2013, 8:41am UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/7 "2013-07-09T08:41:17Z")

</div>

Will do that, thanks for thinking with me.

On Tue, Jul 9, 2013 at 10:38 AM, Radu Gheorghe  
[radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com)wrote:

> Ah, I see now. I see that this one _does_ show you indices:
> 
> curl localhost:9200/\*/a/\_mapping?pretty
> 
> Anyway, I understand the problem now. Maybe an option is to just open an  
> issue and maybe they'll make it more consistent.
> 
> By the way, the UI shapes up really nice 🙂
> 
> On Tue, Jul 9, 2013 at 11:31 AM, Jettro Coenradie \<  
> jettro.coenradie@gridshore.nl\> wrote:
> 
> > I am working on a plugin:  
> > [GitHub - jettro/elasticsearch-gui: An angularJS client for elasticsearch as a plugin](https://github.com/jettro/elasticsearch-gui)  
> > [Elasticsearch gui](http://www.gridshore.nl/esgui/#/home)
> > 
> > At the moment I am thinking about a better way to present a dropdown with  
> > all possible fields. I want to limit the fields based on prior selected  
> > index(es) or type(s). It would be nice if the result of the following type  
> > of queries would have the same structure:
> > 
> > [http://localhost:9200/\_mapping](http://localhost:9200/_mapping)  
> > [http://localhost:9200/index\_a/\_mapping](http://localhost:9200/index_a/_mapping)  
> > [http://localhost:9200/index\_a,index\_b/\_mapping](http://localhost:9200/index_a,index_b/_mapping)  
> > [http://localhost:9200/index\_a/type\_a/\_mapping](http://localhost:9200/index_a/type_a/_mapping)  
> > [http://localhost:9200/index\_a/type\_a,type\_b/\_mapping](http://localhost:9200/index_a/type_a,type_b/_mapping)  
> > [http://localhost:9200/\*/type\_a/\_mapping](http://localhost:9200/*/type_a/_mapping)  
> > [http://localhost:9200/\_all/type\_a/\_mapping](http://localhost:9200/_all/type_a/_mapping)
> > 
> > On Tue, Jul 9, 2013 at 8:56 AM, Radu Gheorghe \<[radu.gheorghe@sematext.com](mailto:radu.gheorghe@sematext.com)
> > 
> > > wrote:
> > 
> > > Hi Jettro,
> > > 
> > > On Tue, Jul 9, 2013 at 9:15 AM, Jettro Coenradie \<  
> > > [jettro.coenradie@gmail.com](mailto:jettro.coenradie@gmail.com)\> wrote:
> > > 
> > > > Hi Radu, thank you for your answer. I know there is more to it. But  
> > > > what if you do this:
> > > > 
> > > > [http://localhost:9200/\_all/blog-item/\_mapping?pretty](http://localhost:9200/_all/blog-item/_mapping?pretty)
> > > 
> > > It seems to me that it will just return the first "blog-item" mapping it  
> > > finds. For example, if you have two indices with this mapping, the command  
> > > above will only return one of them. And you probably wouldn't know which  
> > > index it comes from.
> > > 
> > > > Than you do not get back the index, so you get back the type without  
> > > > the index it belongs to. I am not sure, is it possible to create a type  
> > > > without an index and reuse the same type among indexes?
> > > 
> > > No, you can't create a type without an index. But you can use templates  
> > > where you can automatically create the same mappings to all new indices  
> > > that match the template pattern:  
> > > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/)
> > > 
> > > > In any case, it just makes doing my generic stuff a bit harder, in the  
> > > > end I'll go around it.
> > > 
> > > Can you share what is the generic stuff you're trying to do here?
> > > 
> > > ## Best regards, Radu
> > > 
> > > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe](https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe).  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> > 
> > --  
> > Jettro Coenradie  
> > [http://www.gridshore.nl](http://www.gridshore.nl)
> > 
> > --  
> > 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).
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe](https://groups.google.com/d/topic/elasticsearch/EZyxjQeD3rk/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Jettro Coenradie

> **[Gridshore](https://www.gridshore.nl/)**
>
> A weblog about software engineering, Architecture, Technology an other things we like.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:27am UTC](https://discuss.elastic.co/t/using-the--mapping-api/12701/8 "2017-07-06T02:27:30Z")

</div>


