READs in Insert VS update

We have requirement where we first need to add the document and then update the document.
We are for now, using update api to do add and update.
I see many reads in disk and if we disable the indexing then reads decrease to great extend.

Is update api is making the read?

If I change the update api to index api with ID, would it make any difference.
I have this question as I see if you pass ID in index api, and try to index same document twice with same id, then Es would change the version of document, Which made me suspicious that, ES is doing read is index as well. Is that true?

Would changing from UPDATE to Index make any difference on READ?

Index a document is a write (index operation of the whole content).
Index again a document is a delete + index operation of the whole content
Update a document is a get + merge in memory the previous content with the new one + delete + index operation of the whole content

HTH

So does Elasticsearch do GET request to find out document with same ID already exist?

When doing updates you mean? Yes.

Not at time of update.

If I index one document with ID and then again execute index request with same ID? Does it do get request to find its version 2?

Not really. It will just delete the old doc and create a new one

Ok Thanks

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