How Documents read and write work in Elasticsearch If we doing this on the same document simultaneously?

Hi,

I'm new to Elasticsearch.I want to know how Read and Write operation simultaneously works in Elasticsearch.

Thanks!

It works well. It works well.

What exactly is your concern?

Hi,

I want to know if we are updating any document(write operation) and at the same time someone performing a search (read operation) on the same document. In such case how read and write operation works? search result gets newly updated response or gets the old response? is any latency while performing read and write operation simultaneously? How it's work internally?

So search is delayed by 1 second max by default (see refresh in documentation).

The CRUD API is realtime.

if we are updating any document(write operation) and at the same time someone performing a search (read operation) on the same document

That will work well. The user will see probably the old version of the document when searching while another user is updating the document.

search result gets newly updated response or gets the old response?

After 1s search response will be updated if you run the search again.

I hope this clarified a bit.

I'd recommend reading this book: Getting Started | Elasticsearch: The Definitive Guide [2.x] | Elastic

It's a bit outdated but most of the questions you are asking are answered correctly there. To name a few of chapters:

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