当前位置: 代码迷 >> 综合 >> lucene 错误 no segments* file found in org.apache.lucene.store.FSDirectory@ write.lock
  详细解决方案

lucene 错误 no segments* file found in org.apache.lucene.store.FSDirectory@ write.lock

热度:62   发布时间:2024-01-21 22:51:17.0

 

开的时候 以为是 程序没有读写权限

 

后来网上查到相关资料

writer = new IndexWriter(DIR, new StandardAnalyzer(), false);
writer = new IndexWriter(DIR, new StandardAnalyzer(), true);
在索引没有建立前,使用增量索引时,会发生这个异常
在索引建立时使用writer = new IndexWriter(DIR, new StandardAnalyzer(), true);
以后使用writer = new IndexWriter(DIR, new StandardAnalyzer(), false);

 

  相关解决方案