# GetMapping using Java API

**URL:** <https://discuss.elastic.co/t/getmapping-using-java-api/4383>\
**Category:** Elasticsearch\
**Created:** [May 11, 2011, 2:54pm UTC](https://discuss.elastic.co/t/getmapping-using-java-api/4383 "2011-05-11T14:54:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![plaflamme](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@plaflamme](https://discuss.elastic.co/u/plaflamme)\
**Post date:** [May 11, 2011, 2:54pm UTC](https://discuss.elastic.co/t/getmapping-using-java-api/4383/1 "2011-05-11T14:54:50Z")

</div>

Hi,

How do I invoke GetMapping using the Java client? I tried the GetRequest  
(using "\_mapping" as the document ID), but that seems to be for getting  
documents only.

I've successfully made a PutMapping request and added some stuff in "\_meta".  
Now I need to read it back...

Thanks,  
Philippe

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 11, 2011, 4:58pm UTC](https://discuss.elastic.co/t/getmapping-using-java-api/4383/2 "2011-05-11T16:58:26Z")

</div>

There isn't an explicit GetMapping API, it uses the Java cluster state API. See here: [https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/mapping/get/RestGetMappingAction.java](https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/mapping/get/RestGetMappingAction.java).  
On Wednesday, May 11, 2011 at 5:54 PM, Philippe Laflamme wrote:

> Hi,
> 
> How do I invoke GetMapping using the Java client? I tried the GetRequest (using "\_mapping" as the document ID), but that seems to be for getting documents only.
> 
> I've successfully made a PutMapping request and added some stuff in "\_meta". Now I need to read it back...
> 
> Thanks,  
> Philippe

---

<div class="post-metadata">

**Author:** ![plaflamme](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@plaflamme](https://discuss.elastic.co/u/plaflamme)\
**Post date:** [May 11, 2011, 5:57pm UTC](https://discuss.elastic.co/t/getmapping-using-java-api/4383/3 "2011-05-11T17:57:21Z")

</div>

Got it, thanks.

On Wed, May 11, 2011 at 12:58, Shay Banon [shay.banon@elasticsearch.com](mailto:shay.banon@elasticsearch.com)wrote:

> There isn't an explicit GetMapping API, it uses the Java cluster state  
> API. See here:  
> [https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/mapping/get/RestGetMappingAction.java](https://github.com/elasticsearch/elasticsearch/blob/master/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/mapping/get/RestGetMappingAction.java)  
> .
> 
> On Wednesday, May 11, 2011 at 5:54 PM, Philippe Laflamme wrote:
> 
> Hi,
> 
> How do I invoke GetMapping using the Java client? I tried the GetRequest  
> (using "\_mapping" as the document ID), but that seems to be for getting  
> documents only.
> 
> I've successfully made a PutMapping request and added some stuff in  
> "\_meta". Now I need to read it back...
> 
> Thanks,  
> Philippe

---

<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, 4:06am UTC](https://discuss.elastic.co/t/getmapping-using-java-api/4383/4 "2017-07-06T04:06:26Z")

</div>


