如何解决将 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 一起使用?
解决方法
我重新创建了核心和索引,因为 Solr 似乎不能很好地处理过去创建的多个主要版本的索引。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。