Lucene Index 从 4.6 版本升级到 8.0.0

Jyo*_*sna 6 java lucene

我正在尝试将 Lucene 索引从 4.6 升级到 8.0.0。当我尝试使用以下方法升级工具时:

java -cp lucene-core.jar:lucene-backward-codecs.jar \
 org.apache.lucene.index.IndexUpgrader -delete-prior-commits  \
/scratch/***/workspaces/trunk/****/indexes/4.6/
Run Code Online (Sandbox Code Playgroud)

脚本从4.65.5.55.5.56.6.66.6.6到都运行良好7.7.2。但是当我尝试从它升级7.7.28.0.0它时会抛出如下错误。

Exception in thread "main" org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path="/scratch/**/workspaces/trunk/**/indexes/4.6/sd/segments_9"))): This index was initially created with Lucene 6.x while the current version is 8.0.0 and Lucene only supports reading the current and previous major versions.. This version of Lucene only supports indexes created with release 7.0 and later.
    at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:318)
    at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:289)
    at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:846)
    at org.apache.lucene.index.IndexUpgrader.upgrade(IndexUpgrader.java:167)
    at org.apache.lucene.index.IndexUpgrader.main(IndexUpgrader.java:78)
Run Code Online (Sandbox Code Playgroud)

我们想从 升级4.68.0.0. 直到7.7.2它升级没有任何问题,但是当我7.7.2在我的代码索引中使用 Lucene 版本时,它工作正常。但是 Lucene8.0.0不起作用。

请帮我升级 8.0.0

Jyo*_*sna 4

  1. 如果我们要升级多个主要版本,则必须重新索引。
  2. 多个主要版本升级一直是不鼓励的,并且从未保证可以工作,但现在此类升级被明确拒绝。
  3. 当我们使用 Lucene 6 中的 IndexUpgrader 时,Lucene 版本被写入索引中。记录的版本由版本 7 的升级程序保留。当版本 8 随后读取索引时,它会抱怨,因为原始索引不是由版本 7 或更高版本写入的。

  • 我自己刚才也发现了同样的事情。从 v7 开始,它确实升级了所有段,但保留了在 v6 时创建的版本。这很奇怪……如果它将所有索引数据升级到 v7,难道它不能更新该值以表明它现在是在 v7 中创建的吗?现在我一直在试图弄清楚如何进行最后两个版本升级。我们无法重新索引,因为我们没有用于创建索引的原始文本。:( (2认同)