GetResponse.getField deprecation in Java API

(Fabrizio Fortino) #1

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?


(David Pilato) #2

The same exact question has been raised some days ago.

@Deprecated will be removed on this method.

(system) #3

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