# How to get mappings using the Java API with ElasticSearch 0.90.10 and 1.0.0 RC1

**URL:** <https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442>\
**Category:** Elasticsearch\
**Created:** [January 28, 2014, 8:15am UTC](https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442 "2014-01-28T08:15:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thierry\_Templier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thierry_templier/32/1745_2.png) [@Thierry\_Templier](https://discuss.elastic.co/u/Thierry_Templier)\
**Post date:** [January 28, 2014, 8:15am UTC](https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442/1 "2014-01-28T08:15:57Z")

</div>

Hello,

I wonder what is the best way to get the mappings for an index using the  
ElasticSearch Java API with  
version 0.90.10. I saw that there is only a GetFieldMappingsRequest class  
for this version whereas  
a class GetMappingsRequest is now present in 1.0RC1.

Thanks very much for your answer and your help!  
Thierry

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/3d0fb56f-52c6-4b02-96b5-d0728612101d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/3d0fb56f-52c6-4b02-96b5-d0728612101d%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [January 28, 2014, 10:15am UTC](https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442/2 "2014-01-28T10:15:27Z")

</div>

Hi Thierry,  
the get field mapping api[http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html)was recently added to retrieve mappings for specific fields. If you need to  
read the whole mapping I would still use the get mapping api, while I would  
use the get field mapping if you only need to get the mapping for a few  
fields.

On Tuesday, January 28, 2014 9:15:57 AM UTC+1, Thierry Templier wrote:

> Hello,
> 
> I wonder what is the best way to get the mappings for an index using the  
> Elasticsearch Java API with  
> version 0.90.10. I saw that there is only a GetFieldMappingsRequest class  
> for this version whereas  
> a class GetMappingsRequest is now present in 1.0RC1.
> 
> Thanks very much for your answer and your help!  
> Thierry

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2a209b00-76ac-4db3-92b8-ba3df0443753%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2a209b00-76ac-4db3-92b8-ba3df0443753%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Roy\_Russo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roy_russo/32/44835_2.png) [@Roy\_Russo](https://discuss.elastic.co/u/Roy_Russo)\
**Post date:** [January 28, 2014, 2:13pm UTC](https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442/3 "2014-01-28T14:13:11Z")

</div>

Just a side note that the API response format changed in  
1.0.0RC1. [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/_indices_apis.html)

On Tuesday, January 28, 2014 3:15:57 AM UTC-5, Thierry Templier wrote:

> Hello,
> 
> I wonder what is the best way to get the mappings for an index using the  
> Elasticsearch Java API with  
> version 0.90.10. I saw that there is only a GetFieldMappingsRequest class  
> for this version whereas  
> a class GetMappingsRequest is now present in 1.0RC1.
> 
> Thanks very much for your answer and your help!  
> Thierry

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/568456a2-c76b-43ef-ac0a-76b1bd4faffd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/568456a2-c76b-43ef-ac0a-76b1bd4faffd%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![javanna](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/javanna/32/4698_2.png) [@javanna](https://discuss.elastic.co/u/javanna)\
**Post date:** [January 28, 2014, 2:16pm UTC](https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442/4 "2014-01-28T14:16:34Z")

</div>

True, although this relates to the REST api but not to the Java API, for  
which the GetMappingsRequest stays the same. As I said, we introduced the  
get field mapping api and related GetFieldMappingsRequest.

On Tue, Jan 28, 2014 at 3:13 PM, Roy Russo [royrusso@gmail.com](mailto:royrusso@gmail.com) wrote:

> Just a side note that the API response format changed in 1.0.0RC1.  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/_indices_apis.html)
> 
> On Tuesday, January 28, 2014 3:15:57 AM UTC-5, Thierry Templier wrote:
> 
> > Hello,
> > 
> > I wonder what is the best way to get the mappings for an index using the  
> > Elasticsearch Java API with  
> > version 0.90.10. I saw that there is only a GetFieldMappingsRequest class  
> > for this version whereas  
> > a class GetMappingsRequest is now present in 1.0RC1.
> > 
> > Thanks very much for your answer and your help!  
> > Thierry
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/7TOQO2piFV4/unsubscribe](https://groups.google.com/d/topic/elasticsearch/7TOQO2piFV4/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/568456a2-c76b-43ef-ac0a-76b1bd4faffd%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/568456a2-c76b-43ef-ac0a-76b1bd4faffd%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CADdZ9MUzJntjtYO--\_ZqsjXwkOzFG3kT2WV0YJcZp3jHiV%2BTmQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CADdZ9MUzJntjtYO--_ZqsjXwkOzFG3kT2WV0YJcZp3jHiV%2BTmQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Thierry\_Templier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thierry_templier/32/1745_2.png) [@Thierry\_Templier](https://discuss.elastic.co/u/Thierry_Templier)\
**Post date:** [January 30, 2014, 10:11am UTC](https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442/5 "2014-01-30T10:11:40Z")

</div>

Thanks very much, Luca and Roy for your answers!  
Thierry

> True, although this relates to the REST api but not to the Java API,  
> for which the GetMappingsRequest stays the same. As I said, we  
> introduced the get field mapping api and related GetFieldMappingsRequest.
> 
> On Tue, Jan 28, 2014 at 3:13 PM, Roy Russo \<[royrusso@gmail.com](mailto:royrusso@gmail.com)  
> [mailto:royrusso@gmail.com](mailto:royrusso@gmail.com)\> wrote:
> 
> ```
> Just a side note that the API response format changed in 1.0.0RC1.
> http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/_indices_apis.html
> 
> ```

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/52EA255C.6010500%40gmail.com](https://groups.google.com/d/msgid/elasticsearch/52EA255C.6010500%40gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 1:54am UTC](https://discuss.elastic.co/t/how-to-get-mappings-using-the-java-api-with-elasticsearch-0-90-10-and-1-0-0-rc1/15442/6 "2017-07-06T01:54:01Z")

</div>


