I'm a little confused about the inner workings of GET in elasticsearch.
The document states that the GET operation is realtime.
I'm using version 6.8, and the documentation for this version also states the following:
By default, the get API is realtime, and is not affected by the refresh rate of the index (when data will become visible for search). If a document has been updated but is not yet refreshed, the get API will issue a refresh call in-place to make the document visible. This will also make other documents changed since the last refresh visible. In order to disable realtime GET, one can set the realtime parameter to false.
It seems like the GET operation refreshes the document beforehand, and makes all the other updated documents visible because of this refresh. Is this correct?
But I've tested this by creating a document with a refresh rate of 5 minutes, inserting a document, searching it (fails), and getting it by its doc ID (succeeds), then searching the doc again, which fails. The GET operation doesn't seem to trigger the refresh API.
And looking at previous documents, it states that the translog is used to serve CRUD operations in realtime.
The translog is also used to provide real-time CRUD. When you try to retrieve, update, or delete a document by ID, it first checks the translog for any recent changes before trying to retrieve the document from the relevant segment. This means that it always has access to the latest known version of the document, in real-time.
Does anyone know what's actually happening under the hood for this GET operation? Am I misunderstanding the doc? Or can anyone point me to the right documentation, please?