使用Lucene.Net出现了No segments* file found in lucene.net.store.fsdirectory@"XXX" lockFactory=Lucene.Net.Store.NativeFSLockFactory: files:write.lock异常,
string dirPath = @"E:\LuceneIndex";
System.IO.DirectoryInfo directory = System.IO.Directory.CreateDirectory(dirPath);
Lucene.Net.Store.Directory _directory_luce = Lucene.Net.Store.FSDirectory.Open(directory);
Lucene.Net.Analysis.PanGuAnalyzer analyzer = new Lucene.Net.Analysis.PanGuAnalyzer();//
IndexWriter writer = new IndexWriter(_directory_luce, analyzer, false, IndexWriter.MaxFieldLength.LIMITED);
在IndexWriter writer = new IndexWriter(_directory_luce, analyzer, true, IndexWriter.MaxFieldLength.LIMITED);中使用true即可解决