Adding _source field to IndexResponse

Is there a way in the java API to customize the returned IndexResponse (And indexresponses within a BulkResponse) such that the response contains one of the _source fields?

Based on the response here Get certain fields in bulk API response it seems like it should be possible, but I was unable to determine how.

I don't believe you can OOTB.
As mentioned in the thread you linked to, it's easier to call the GET API after that?

Wondering why do you need that after all? Actually you are sending the document you want to index, right? Why reading that again?
Does it relate somehow with ingest node processing?

Calling get right after an index in 5.0 is going to cause a refresh to support the realtime get which is probably not a good thing to do consistently.

1 Like

Very true! I forgot about this one! :slight_smile: Thanks Nik!

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