有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java将Solr索引从6升级到8

我有一个多年前创建的核心,从Solr 6正确运行。x

我已将Solr升级到7.7.3。我启动了IndexUpgrade脚本:

/opt/solr/server/solr-webapp/webapp/WEB-INF/lib$ sudo java -cp lucene-core-7.7.3.jar:lucene-backward-codecs-7.7.3.jar org.apache.lucene.index.IndexUpgrader /var/solr/data/hms/data/index/

它默默地运行,所以我的假设是它做了它必须正确做的事情

然后我升级到Solr 8.7.0,并启动了脚本:

/opt/solr/server/solr-webapp/webapp/WEB-INF/lib$ sudo java -cp lucene-core-8.7.0.jar:lucene-backward-codecs-8.7.0.jar org.apache.lucene.index.IndexUpgrader /var/solr/data/hms/data/index/

最后一个代码退出时出现以下错误:

Exception in thread "main" org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path="/var/solr/data/hms/data/index/segments_asky"))): This index was initially created with Lucene 6.x while the current version is 8.7.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:322)
    at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:291)
    at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:461)
    at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:458)
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:720)
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:672)
    at org.apache.lucene.index.SegmentInfos.readLatestCommit(SegmentInfos.java:463)
    at org.apache.lucene.index.DirectoryReader.listCommits(DirectoryReader.java:260)
    at org.apache.lucene.index.IndexUpgrader.upgrade(IndexUpgrader.java:158)
    at org.apache.lucene.index.IndexUpgrader.main(IndexUpgrader.java:78)
    Suppressed: org.apache.lucene.index.CorruptIndexException: checksum passed (58082b0a). possibly transient resource issue, or a Lucene or JVM bug (resource=BufferedChecksumIndexInput(MMapIndexInput(path="/var/solr/data/hms/data/index/segments_asky")))
        at org.apache.lucene.codecs.CodecUtil.checkFooter(CodecUtil.java:466)
        at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:434)
        ... 9 more

为什么?我是否做得不对,即先将索引从6升级到7,然后再从7升级到8?如何让我的索引与Solr 8一起工作


共 (1) 个答案

  1. # 1 楼答案

    我重新创建了核心和索引,因为Solr似乎无法很好地处理过去创建的多个主要版本的索引