# Sub types

**URL:** <https://discuss.elastic.co/t/sub-types/11117>\
**Category:** Elasticsearch\
**Created:** [March 12, 2013, 6:14pm UTC](https://discuss.elastic.co/t/sub-types/11117 "2013-03-12T18:14:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [March 12, 2013, 6:14pm UTC](https://discuss.elastic.co/t/sub-types/11117/1 "2013-03-12T18:14:29Z")

</div>

Does ES support document subtypes? For example, can I do the following action, and still be able to provide/get mappings for subtype1 and subtype2? Or does ES only support a 2-level structure of index followed by type?

curl -XPOST 'localhost:9200:/index/group/subtype1' -d {…}  
curl -XPOST 'localhost:9200:/index/group/subtype2' -d {…}

curl -XGET 'localhost:9200:/index/group/subtype1/\_mapping'  
curl -XGET 'localhost:9200:/index/group/subtype2/\_mapping'

--  
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:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 13, 2013, 7:24am UTC](https://discuss.elastic.co/t/sub-types/11117/2 "2013-03-13T07:24:47Z")

</div>

Hey,

you always can specify exactly one type for your data being indexed (in the  
URL). I am not sure what your actual use-case is, but you might want to  
read about nested documents and parent child relations.

> **[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.

> **[Fun with elasticsearch's children and nested documents - Space Vatican](https://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/)**
>
> When you’re indexing data, the world is rarely as simple as each document existing in isolation. Sometimes, you’re better off …

--Alex

On Tue, Mar 12, 2013 at 7:14 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:

> Does ES support document subtypes? For example, can I do the following  
> action, and still be able to provide/get mappings for subtype1 and  
> subtype2? Or does ES only support a 2-level structure of index followed by  
> type?
> 
> curl -XPOST 'localhost:9200:/index/group/subtype1' -d {…}  
> curl -XPOST 'localhost:9200:/index/group/subtype2' -d {…}
> 
> curl -XGET 'localhost:9200:/index/group/subtype1/\_mapping'  
> curl -XGET 'localhost:9200:/index/group/subtype2/\_mapping'
> 
> --  
> 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).

--  
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:** ![vinh](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@vinh](https://discuss.elastic.co/u/vinh)\
**Post date:** [March 14, 2013, 7:35am UTC](https://discuss.elastic.co/t/sub-types/11117/3 "2013-03-14T07:35:41Z")

</div>

Thanks Alex!

On Mar 13, 2013, at 12:24 AM, Alexander Reelsen [alr@spinscale.de](mailto:alr@spinscale.de) wrote:

> Hey,
> 
> you always can specify exactly one type for your data being indexed (in the URL). I am not sure what your actual use-case is, but you might want to read about nested documents and parent child relations.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/nested-type.html)  
> [Fun with elasticsearch's children and nested documents - Space Vatican](http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/)
> 
> --Alex
> 
> On Tue, Mar 12, 2013 at 7:14 PM, vinh [vinh@loggly.com](mailto:vinh@loggly.com) wrote:  
> Does ES support document subtypes? For example, can I do the following action, and still be able to provide/get mappings for subtype1 and subtype2? Or does ES only support a 2-level structure of index followed by type?
> 
> curl -XPOST 'localhost:9200:/index/group/subtype1' -d {…}  
> curl -XPOST 'localhost:9200:/index/group/subtype2' -d {…}
> 
> curl -XGET 'localhost:9200:/index/group/subtype1/\_mapping'  
> curl -XGET 'localhost:9200:/index/group/subtype2/\_mapping'
> 
> --  
> 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).
> 
> --  
> 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).

--  
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:46am UTC](https://discuss.elastic.co/t/sub-types/11117/4 "2017-07-06T02:46:35Z")

</div>


