# Get Fields from index

**URL:** <https://discuss.elastic.co/t/get-fields-from-index/8556>\
**Category:** Elasticsearch\
**Created:** [July 29, 2012, 9:12am UTC](https://discuss.elastic.co/t/get-fields-from-index/8556 "2012-07-29T09:12:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Kratz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_kratz/32/2796_2.png) [@Thomas\_Kratz](https://discuss.elastic.co/u/Thomas_Kratz)\
**Post date:** [July 29, 2012, 9:12am UTC](https://discuss.elastic.co/t/get-fields-from-index/8556/1 "2012-07-29T09:12:53Z")

</div>

Hi, forgive me that I'm new to elasticsearch 🙂  
I just try to throw in different docs and want to know what fields  
have been created in the index. Is there a way to ask the index which  
fields it has? (I'm using the java api)

Thx Thomas

---

<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 29, 2012, 4:00pm UTC](https://discuss.elastic.co/t/get-fields-from-index/8556/2 "2012-07-29T16:00:48Z")

</div>

Easiest way would be to get the mapping:

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

If you allow dynamic mappings (the default), the mapping will be  
updated as you add documents to the index. For the Java API, the  
relevant methods are in the ClusterState classes.

--  
Ivan

On Sun, Jul 29, 2012 at 2:12 AM, Thomas Kratz [eiswind@gmail.com](mailto:eiswind@gmail.com) wrote:

> Hi, forgive me that I'm new to elasticsearch 🙂  
> I just try to throw in different docs and want to know what fields  
> have been created in the index. Is there a way to ask the index which  
> fields it has? (I'm using the java api)
> 
> Thx Thomas

---

<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, 3:18am UTC](https://discuss.elastic.co/t/get-fields-from-index/8556/3 "2017-07-06T03:18:33Z")

</div>


