There are two options to update an object in ES:
- using update APIs (via script)
- storing the complete object again with the id set
There are many scenarios when choosing among these two options is easy like:
- When you want to do conditional updates script is the winner.
- In case you in the application logic only have the update part not the complete object than again script is the clear winner.
But I have a situation where I have the complete object in my hand. Out of the complete object I only want to update a very small part. So what should I use, storing the complete object or updating it via script. Which will perform better?