Chris,

When the IndexSearcher gets created, it is read only:

IndexSearcher recordSearcher = new IndexSearcher(IndexMemory, true);

Later in the code, the IndexSearcher may get re-opened. My understanding is
that the IndexSearcher should be still read only even if it gets re-opened,
right?

IndexReader oldReader = recordSearcher.GetIndexReader();
if (!oldReader.IsCurrent())
{
      IndexReader newReader = oldReader.Reopen();
      if (oldReader!= newReader)
      {
          recordSearcher = new IndexSearcher(newReader);
      }
}

Thanks,

Frank

-----Original Message-----
From: Chris Woolum [mailto:[email protected]] 
Sent: Monday, January 24, 2011 11:14 AM
To: [email protected]
Subject: RE: Thread Contention in Lucene.Net 2.9

Hey Frank,

Lucene does not use locks for the index reader. When you initialize the
index, are you loading it in as read only?

Chris      




Reply via email to