# How to get structure of mapping in JSON through Java

**URL:** <https://discuss.elastic.co/t/how-to-get-structure-of-mapping-in-json-through-java/10130>\
**Category:** Elasticsearch\
**Created:** [December 20, 2012, 5:43am UTC](https://discuss.elastic.co/t/how-to-get-structure-of-mapping-in-json-through-java/10130 "2012-12-20T05:43:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sreejith\_Pillai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sreejith_pillai/32/2523_2.png) [@Sreejith\_Pillai](https://discuss.elastic.co/u/Sreejith_Pillai)\
**Post date:** [December 20, 2012, 5:43am UTC](https://discuss.elastic.co/t/how-to-get-structure-of-mapping-in-json-through-java/10130/1 "2012-12-20T05:43:11Z")

</div>

Hello,  
Is it possible in Elasticsearch to retrieve index mapping into a whole  
JSON format in Java ??  
Curl -XGET '[http://localhost:9200/indexname/\_mapping](http://localhost:9200/indexname/_mapping)' will give the  
whole structure of Index in JSON format. I wabt the same structure in  
Java. Is it possible ? Any Java Api is available ??  
Any help will be highy appreciated  
Thanks

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 20, 2012, 6:11am UTC](https://discuss.elastic.co/t/how-to-get-structure-of-mapping-in-json-through-java/10130/2 "2012-12-20T06:11:44Z")

</div>

Hey,

Look here: [https://github.com/elasticsearchfr/elasticsearch-java-tests/blob/master/src/test/java/org/elasticsearchfr/tests/ES002GetMappingTest.java](https://github.com/elasticsearchfr/elasticsearch-java-tests/blob/master/src/test/java/org/elasticsearchfr/tests/ES002GetMappingTest.java)

HTH

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 20 déc. 2012 à 06:43, SearchTech [sreejithpillai27.in@gmail.com](mailto:sreejithpillai27.in@gmail.com) a écrit :

> Hello,  
> Is it possible in Elasticsearch to retrieve index mapping into a whole  
> JSON format in Java ??  
> Curl -XGET '[http://localhost:9200/indexname/\_mapping](http://localhost:9200/indexname/_mapping)' will give the  
> whole structure of Index in JSON format. I wabt the same structure in  
> Java. Is it possible ? Any Java Api is available ??  
> Any help will be highy appreciated  
> Thanks
> 
> --

--

---

<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:59am UTC](https://discuss.elastic.co/t/how-to-get-structure-of-mapping-in-json-through-java/10130/3 "2017-07-06T02:59:12Z")

</div>


