I use ES 5.0.2 and Transport 5.0.2. The GetResponse.getFields() is marked deprecated with a notice to use .getSource() instead. However, if I submit a Get request with stored_fields=x,y,z, I get back a 'fields' element, and calling .getSource() returns an empty map, while getFields() returns the stored fields.
So how should I retrieve stored fields? I know I can fetch the entire source and then filter in the client, but I wish to filter at the server side already, so I load only requested fields.
Thanks @dadoonet, but my question is about the deprecation of getFields() in the transport client. If it's deprecated, what should I use instead? Currently it looks like if I want to retrieve stored fields, I must use that API. If so, why is it deprecated?
Thanks for the report @Shai_Erera. I removed the deprecation of these functions, the comment was misleading and I think that the naming is fine. The fields in the response are the requested stored fields + the metadata fields which is why we will continue to call it getField(s).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.