I was wondering if there is any way to obtain an InputStream when
running a get query using the Java API? The reason I am asking is
because I feel that loading documents with large attachments into
memory before forwarding attachments on to a 3rd party client is
somewhat inefficient. (i.e. downloading via HTTP)
What I would like to achieve ideally is obtain a stream to a document
attachment, pass that stream to the web server so that it forwards it
to the client, and base64 decode it on the fly. Intuition tells me
that this should be much more efficient than fetching the entire
document from ES, base64 decoding it, and then passing that in-memory
byte array to the web server as a stream.
Please correct me if I am missing something obvious. Thanks in advance!