What happens during Commit while using Lucene NRT
We're using Lucene.NET 2.9.2, and would like to move over to the Near Realtime functionality of Lucene.
We get the IndexReader
from the IndexWriter
(thus using NRT
). My understanding is that when using it this way, the IndexReader will also contain search results of those documents that have been added, but not yet commited (we're checking if the IndexReader
iscurrent
, and use reopen
if it's not).
Let's say I've added 50 documents, and decide to Commit
them to the index, and let's say the document开发者_如何学JAVAs are big, and commiting takes 5 seconds.
What happens during these 5 seconds if a new search comes in? Will the internal RAMDirectory
hold on to those 50 documents until the commit is complete? Or will there be a situation that those 50 documents will be lost for 5 seconds?
You will be able to search those records still. Your reader still points to the uncommitted version of the index as if you never called commit. Once commit is finished isCurrent will reflect you need a new reader.
精彩评论