On 11/16/2018 11:54 AM, Walter Underwood wrote:
Does a soft commit always open a new Searcher?

In general, yes.  To quote the oft-referenced blog post ... hard commits are about durability, soft commits are about visibility.

I actually don't know if "openSearcher=false" would work on a soft commit, but even if it does (and prevents opening a new searcher), it's not a particularly useful option for soft commit.That combination goes against the entire reason that soft commit exists.

For hard commit, setting openSearcher=false does make sense -- firing that commit is usually very fast, and the desired outcome is a side effect -- starting a new transaction log.

I’ve been reading all the documentation and articles I can find, and they all 
say that soft commit makes documents visible for searching. They don’t 
specifically say that they invalidate the caches and/or open a new Searcher. I 
guess I can see a use case where it would be OK for the caches to have stale 
information for a while, but uncached searches would find the new documents. 
And invalidating individual entries in the document cache might be doable.

The only way you'll see changes is by opening a new searcher.  The existing searcher will not query the new index state.  When a new searcher is opened, it has its own cache instances, and those instances are empty.  As you might already know, autowarming reaches into the old searcher's caches and uses the queries it finds there to warm the new caches.

Thanks,
Shawn

Reply via email to