I\'m building an ASP.NET MVC site where I want to use Lucene.Net for search. I\'ve already built a SearchController and all of its methods, but I\'m getting an error at runtime
try
{
writer = new IndexWriter(directory, new StandardAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
}
catch (LockObtainFailedException ex)
{
DirectoryInfo indexDirInfo = new DirectoryInfo(directory);
FSDirectory indexFSDir = FSDirectory.Open(indexDirInfo, new Lucene.Net.Store.SimpleFSLockFactory(indexDirInfo));
IndexWriter.Unlock(indexFSDir);
writer = new IndexWriter(directory, new StandardAnalyzer(), IndexWriter.MaxFieldLength.UNLIMITED);
}