Adding objects to an Array filed in Elastic Search index using Java High level Rest Client

Why?

Again, that's a bit counter intuitive when you deal with search engines. That's the reason, I'm asking you questions about the use case. Probably someone can give you the answer to the question you asked, but this might be a good answer to a bad question.

I'm not experimented in painless so I can't really help more. If you want to continue on exploring this nested update thing, I'd recommend to provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

So don't even think of using Java code first. Once the solution is found in pure Elasticsearch/Kibana script, we can help if needed to move to Java code but that should be straight forward.