# GetResponse.getField deprecation in Java API

**URL:** https://discuss.elastic.co/t/getresponse-getfield-deprecation-in-java-api/68373
**Category:** Elasticsearch
**Created:** [December 7, 2016, 10:15pm UTC](https://discuss.elastic.co/t/getresponse-getfield-deprecation-in-java-api/68373 "2016-12-07T22:15:15Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Fabrizio\_Fortino](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fabrizio_fortino/32/1719_2.png) [@Fabrizio\_Fortino](https://discuss.elastic.co/u/Fabrizio_Fortino)
#### Post date: [December 7, 2016, 10:15pm UTC](https://discuss.elastic.co/t/getresponse-getfield-deprecation-in-java-api/68373/1 "2016-12-07T22:15:16Z")

</div>

With Elasticsearch 5.x the method `GetResponse.getField()` has been deprecated.

The javadoc suggests to use `getSource()` instead but I don't think this is enough.

Let's say I have a bunch of fields stored and other fields not stored. If I want to read just the stored fields without the entire source I can use `FetchSourceContext.DO_NOT_FETCH_SOURCE` specifying the stored fields to return.

In this case `GetResponse.getField()` is needed to extract the fields' values. Why this method has been deprecated. Is there another way to retrieve just the stored fields without loading the entire source?

Cheers!

---

<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 7, 2016, 10:38pm UTC](https://discuss.elastic.co/t/getresponse-getfield-deprecation-in-java-api/68373/2 "2016-12-07T22:38:26Z")

</div>

The same exact question has been raised some days ago.

`@Deprecated` will be removed on this method.

---

<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: [January 4, 2017, 10:38pm UTC](https://discuss.elastic.co/t/getresponse-getfield-deprecation-in-java-api/68373/3 "2017-01-04T22:38:42Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
