【问题标题】:How to recreate deleted segments file in Lucene Index?如何在 Lucene Index 中重新创建已删除的段文件?
【发布时间】:2014-01-25 13:07:17
【问题描述】:

我不小心删除了我的程序的 Lucence 索引文件夹。当我运行我的程序时,它显示为...

Exception in thread "main" org.apache.lucene.index.IndexNotFoundException: no segments* file found in org.apache.lucene.store.MMapDirectory@M:\fbl\org.fazlan.lucene.ms.demo\src\main\resources\index2 lockFactory=org.apache.lucene.store.NativeFSLockFactory@cb17ecc: files: [write.lock, _0.fdt, _0.fdx]
at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:801)
at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:52)
at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:66)
at org.apache.lucene.index.IndexReader.open(IndexReader.java:291)
at org.fazlan.lucene.demo.Searcher.<init>(Searcher.java:28)
at org.fazlan.lucene.demo.FileIndexApplication.main(FileIndexApplication.java:50)

我能做什么?我在互联网上搜索但找不到任何解决方案?有没有办法用删除的段文件重建索引?

【问题讨论】:

    标签: indexing lucene segment


    【解决方案1】:

    这应该可以通过创建与您现在拥有的段大小相同的索引来实现。然后将其段文件用于您的索引。您需要替换段文件中与您的实际文件名匹配的文件名。

    【讨论】:

      猜你喜欢
      • 2012-08-19
      • 1970-01-01
      • 2023-03-12
      • 2012-03-12
      • 2011-11-11
      • 1970-01-01
      • 2021-04-04
      • 2016-09-02
      • 1970-01-01
      相关资源
      最近更新 更多