Will the result getting by id be cached or not?

(Makeyang) #1

I'll use get by id a lot and I wonder if it is cached or not?
if not, is there a way to achieve so without loseing real time capibility?

(Zachary Tong) #2

No, get-by-id isn't cached explicitly by Elasticsearch. The segments holding the documents being fetched may well be cached in the OS filesystem cached if they are used repeatedly, but that's not an explicit cache that we control.

ES doesn't cache get-by-id because the operation is very fast, and caching the results would likely not help at all (or make things worse).

(system) #3