# Java Api for get Mapping of index or index/type

**URL:** <https://discuss.elastic.co/t/java-api-for-get-mapping-of-index-or-index-type/8587>\
**Category:** Elasticsearch\
**Created:** [July 31, 2012, 8:29pm UTC](https://discuss.elastic.co/t/java-api-for-get-mapping-of-index-or-index-type/8587 "2012-07-31T20:29:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajasuja18](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@ajasuja18](https://discuss.elastic.co/u/ajasuja18)\
**Post date:** [July 31, 2012, 8:29pm UTC](https://discuss.elastic.co/t/java-api-for-get-mapping-of-index-or-index-type/8587/1 "2012-07-31T20:29:06Z")

</div>

Hello Everyone,

I know using curl, we can get the mapping  
[http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html)

What is the equivalent Java api for the same? Short sample code would help

Thanks in advance..!!

---

<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 31, 2012, 8:50pm UTC](https://discuss.elastic.co/t/java-api-for-get-mapping-of-index-or-index-type/8587/2 "2012-07-31T20:50:02Z")

</div>

Take a look at the RestGetMappingAction class. It converts the REST  
request into the Java API format and is a great example to start from.

--  
Ivan

On Tue, Jul 31, 2012 at 1:29 PM, ajasuja [jasuja.ankit@gmail.com](mailto:jasuja.ankit@gmail.com) wrote:

> Hello Everyone,
> 
> I know using curl, we can get the mapping  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-get-mapping.html)
> 
> What is the equivalent Java api for the same? Short sample code would help
> 
> Thanks in advance..!!

---

<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/java-api-for-get-mapping-of-index-or-index-type/8587/3 "2017-07-06T03:18:13Z")

</div>


