# Retrieve mapping of Index in JSON format through Java API

**URL:** <https://discuss.elastic.co/t/retrieve-mapping-of-index-in-json-format-through-java-api/10129>\
**Category:** Elasticsearch\
**Created:** [December 20, 2012, 5:16am UTC](https://discuss.elastic.co/t/retrieve-mapping-of-index-in-json-format-through-java-api/10129 "2012-12-20T05:16:38Z")\
**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:16am UTC](https://discuss.elastic.co/t/retrieve-mapping-of-index-in-json-format-through-java-api/10129/1 "2012-12-20T05:16:38Z")

</div>

Hello,  
Is it possible to retrieve ElasticSearch index mapping into a whole JSON format in JAVA

curl -XGET '[http://localhost:9200/index/\_mapping](http://localhost:9200/index/_mapping)' will give the whole structure of index in JSON. I want the same structure in JAVA.. Is it possible in Java ?

Any help will be highly 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, 3:32pm UTC](https://discuss.elastic.co/t/retrieve-mapping-of-index-in-json-format-through-java-api/10129/2 "2012-12-20T15:32:49Z")

</div>

I think I already answered to this question this morning:

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:16, Sreejith Pillai [sreejithpillai27.in@gmail.com](mailto:sreejithpillai27.in@gmail.com) a écrit :

> Hello,  
> Is it possible to retrieve Elasticsearch index mapping into a whole JSON  
> format in JAVA
> 
> curl -XGET '[http://localhost:9200/index/\_mapping](http://localhost:9200/index/_mapping)' will give the whole  
> structure of index in JSON. I want the same structure in JAVA.. Is it  
> possible in Java ?
> 
> Any help will be highly appreciated  
> Thanks,
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Retrieve-mapping-of-Index-in-JSON-format-through-Java-API-tp4027232.html](http://elasticsearch-users.115913.n3.nabble.com/Retrieve-mapping-of-Index-in-JSON-format-through-Java-API-tp4027232.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --

--

---

<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/retrieve-mapping-of-index-in-json-format-through-java-api/10129/3 "2017-07-06T02:59:04Z")

</div>


