Index vs Update for partial updates


I'm having a hard time deciding on the Index vs Update APIs for a particular use case.
Let's say I have an index with documents containing a name field, which nests a string translated in different languages/locales:

    name: {
      "en-US": "Something",
      "en-GB": "Something else",

Once every few seconds, I need to update a set such docs (1000s), but since I can't know all the languages inside the name field, I want the behavior of Index - overwrite the entire field instead of upserting only the provided languages.
However, ~99% of the time, nothing is changed in the document, so it would be reindexed when a noop would be more fitting.

So, to summarize:

  • Index reindexes noops, which happen most of the time.
  • Update does not delete fields not provided in the request.

Is there a solution for this?

From an Elasticsearch point of view, this sort of thing is decided in the client, or it'll treat the request as an update and replace the document as you are seeing.

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