Thanks for the reply. I have gone through that document before even putting my question here. But unfortunately I am not able to build the UpdateRequest which I can use for the update function.
Do you have any sample java code which I can take as a reference to build the request ?
Also I am not sure which one is best in my case, update() or updateByQuery().