So, total = multiplier * subtotal. Multiplier is determined by User on my application. When multiplier is changed to another value, I have to update multiplier and total in all documents. I'm pondering how to achieve this with the best performance. I came up with strategies below:
I don't have any idea how to update nested object fields using update_by_query. Is it also possible to update those fields in native script plugin (Java)? (in my real case I'm using native script)
Batch GET and Bulk UPDATE
The last strategy that I'm thinking of. In my code, get all documents, looping each document to update the multiplier and total and send them back to elasticsearch. I'm worry about the performance especially when there are 100,000 documents.
Is there any other recommended strategy? What do you suggest?