Partial update vs re-index

Hi, Elastic team.

My index contains 5 - 10 millions documents. Every document has the same structure. Each document contains 10 fields, such as first_name, last_name, nick_name, weight, height, preferred_language, preferred_currency, etc.

Averagely, 100 documents will be updated very day. For example, changing the "preferred_language" from "en-GB" to "en-US" or changing the weight from "68.1 kg" to "67.5 kg".

I plan to use the (PUT) /[index name]/_doc/[doc id] to (1) create a document or (2)partially updating an existing document. By the way, I will decide the "id" of each document and stop Elasticsearch auto-generation.

Is that a good choice to partially update an existing document?

Shall I switch to a different API endpoint to partial update, if my index contains much more documents or many documents need to be changed per day or documents contains much more than 10 fields?


Check out the Update API... if you can recreate the whole document on the client side then storing the document again makes sense as well. Pick what suits your use-case best.

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