Spinoff from #14121...
Today, when ES detects it's using too much heap vs the configured indexing buffer (default 10% of JVM heap) it opens a new searcher to force Lucene to move the bytes to disk, clear version map, etc.
But this has the unexpected side effect of making newly indexed/deleted documents visible to future searches, which is not nice for users who are trying to prevent that, e.g. #3593.
As @uschindler suggested in that issue, I think ES should have two separate searchers from the engine: one for search visibility, only ever refreshed according to the user's wishes, and another, used internally for freeing up heap, version map lookups, etc. Lucene will be efficient about this, sharing segment readers across those two searchers.
I haven't started on this (need to finish #14121 first!) so if someone wants to take it, please feel free!