# How to see all document types for a give index?

**URL:** https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385
**Category:** Elasticsearch
**Created:** [June 29, 2014, 4:40pm UTC](https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385 "2014-06-29T16:40:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jinyuan\_Zhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinyuan_zhou/32/90185_2.png) [@Jinyuan\_Zhou](https://discuss.elastic.co/u/Jinyuan_Zhou)
#### Post date: [June 29, 2014, 4:40pm UTC](https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385/1 "2014-06-29T16:40:09Z")

</div>

Thanks,

--  
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/2097260f-9157-4de3-aedf-5713027d88ef%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2097260f-9157-4de3-aedf-5713027d88ef%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: [June 30, 2014, 10:46pm UTC](https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385/2 "2014-06-30T22:46:23Z")

</div>

Great question. I do not think there is an API to get that data (someone  
please correct me if I am wrong), but since the type is basically just  
another field inside the Lucene document, you can also run a  
aggregation/facet on the implicit field called \_type:

{  
"size": 0,  
"query": {"match\_all": {}},  
"aggs" : {  
"types" : {  
"terms" : { "field" : "\_type" }  
}  
}  
}

Cheers,

Ivan

On Sun, Jun 29, 2014 at 9:40 AM, Jinyuan Zhou [zhou.jinyuan@gmail.com](mailto:zhou.jinyuan@gmail.com)  
wrote:

> Thanks,
> 
> --  
> 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/2097260f-9157-4de3-aedf-5713027d88ef%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2097260f-9157-4de3-aedf-5713027d88ef%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2097260f-9157-4de3-aedf-5713027d88ef%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2097260f-9157-4de3-aedf-5713027d88ef%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%3DcQBvxuxkia1wXGpZNNME4\_yycZjBX\_Enae1u-3yEfV3MTA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBvxuxkia1wXGpZNNME4_yycZjBX_Enae1u-3yEfV3MTA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![smonasco\_2](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@smonasco\_2](https://discuss.elastic.co/u/smonasco_2)
#### Post date: [July 1, 2014, 1:23pm UTC](https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385/3 "2014-07-01T13:23:48Z")

</div>

I believe [http://localhost:9200/index/\_mapping](http://localhost:9200/index/_mapping) will give you types.

It is an indirect method for sure, but that kind of metadata is going to be in memory and not require fielddata cache.

--  
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/75b3cb8c-5c22-48e5-88d3-d7f64377ca94%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/75b3cb8c-5c22-48e5-88d3-d7f64377ca94%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Jinyuan\_Zhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jinyuan_zhou/32/90185_2.png) [@Jinyuan\_Zhou](https://discuss.elastic.co/u/Jinyuan_Zhou)
#### Post date: [July 1, 2014, 4:58pm UTC](https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385/4 "2014-07-01T16:58:25Z")

</div>

Thanks, I guess this may be the perfect solution.

Jinyuan (Jack) Zhou

On Tue, Jul 1, 2014 at 6:23 AM, smonasco [smonasco@gmail.com](mailto:smonasco@gmail.com) wrote:

> I believe [http://localhost:9200/index/\_mapping](http://localhost:9200/index/_mapping) will give you types.
> 
> It is an indirect method for sure, but that kind of metadata is going to  
> be in memory and not require fielddata cache.
> 
> --  
> 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/j4z7FNOScEI/unsubscribe](https://groups.google.com/d/topic/elasticsearch/j4z7FNOScEI/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/75b3cb8c-5c22-48e5-88d3-d7f64377ca94%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/75b3cb8c-5c22-48e5-88d3-d7f64377ca94%40googlegroups.com)  
> .  
> 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/CANBTPCGRR63bQ3QcUaJ7yNU2h7wDDGaCEg5ODrSMM8xZiu9ZdA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CANBTPCGRR63bQ3QcUaJ7yNU2h7wDDGaCEg5ODrSMM8xZiu9ZdA%40mail.gmail.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: [July 1, 2014, 5:26pm UTC](https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385/5 "2014-07-01T17:26:23Z")

</div>

I knew there had to be a simpler solution! Missed the extremely obvious.

--  
Ivan

On Tue, Jul 1, 2014 at 9:58 AM, Jinyuan Zhou [zhou.jinyuan@gmail.com](mailto:zhou.jinyuan@gmail.com) wrote:

> Thanks, I guess this may be the perfect solution.
> 
> Jinyuan (Jack) Zhou
> 
> On Tue, Jul 1, 2014 at 6:23 AM, smonasco [smonasco@gmail.com](mailto:smonasco@gmail.com) wrote:
> 
> > I believe [http://localhost:9200/index/\_mapping](http://localhost:9200/index/_mapping) will give you types.
> > 
> > It is an indirect method for sure, but that kind of metadata is going to  
> > be in memory and not require fielddata cache.
> > 
> > --  
> > 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/j4z7FNOScEI/unsubscribe](https://groups.google.com/d/topic/elasticsearch/j4z7FNOScEI/unsubscribe).  
> > To unsubscribe from this group and all its topics, 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/75b3cb8c-5c22-48e5-88d3-d7f64377ca94%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/75b3cb8c-5c22-48e5-88d3-d7f64377ca94%40googlegroups.com)  
> > .  
> > 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/CANBTPCGRR63bQ3QcUaJ7yNU2h7wDDGaCEg5ODrSMM8xZiu9ZdA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CANBTPCGRR63bQ3QcUaJ7yNU2h7wDDGaCEg5ODrSMM8xZiu9ZdA%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CANBTPCGRR63bQ3QcUaJ7yNU2h7wDDGaCEg5ODrSMM8xZiu9ZdA%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CANBTPCGRR63bQ3QcUaJ7yNU2h7wDDGaCEg5ODrSMM8xZiu9ZdA%40mail.gmail.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%3DcQAHB4oJnnb0MTCytc-4%3DDYcstmgrObgy%2B%3DT\_u%3DtkWynHg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQAHB4oJnnb0MTCytc-4%3DDYcstmgrObgy%2B%3DT_u%3DtkWynHg%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:18am UTC](https://discuss.elastic.co/t/how-to-see-all-document-types-for-a-give-index/18385/6 "2017-07-06T01:18:38Z")

</div>


