On 11/16/2018 12:21 PM, Shawn Heisey wrote:
On 11/16/2018 11:54 AM, Walter Underwood wrote:
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.

A followup.  I didn't address the part about possibly re-using cache info.

Anytime there is a new searcher, Solr and Lucene cannot know whether the Lucene document IDs referenced in the old cache have changed.  It's entirely possible when opening a new searcher that *EVERY* document ID has changed.  Also, documents referenced in the cache might have been deleted, and documents that have just been added might match the query.

So ALL of the information in the old caches is suspect ... there's no fast and easy way to detect which parts can be re-used, so NONE of it is re-used.  To guarantee correct results, each query must be re-executed on the new index.  Which is exactly what autowarming does.

Thanks,
Shawn

Reply via email to