I am trying to upgrade Lucene index from 4.6 to 8.0.0. When I'm trying to upgrade tool using:
java -cp lucene-core.jar:lucene-backward-codecs.jar \
org.apache.lucene.index.IndexUpgrader -delete-prior-commits \
/scratch/***/workspaces/trunk/****/indexes/4.6/
Script is working fine from 4.6
to 5.5.5
, 5.5.5
to 6.6.6
, 6.6.6
to 7.7.2
. But When I am trying to upgrade from 7.7.2
to 8.0.0
it is throwing error as below.
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)
We want to upgrade from 4.6
to 8.0.0
. Till 7.7.2
it is upgrading without any issues, but when I'm using for Lucene version 7.7.2
in my code indexing is working fine. But Lucene 8.0.0
is not working.
Please help me in upgrading 8.0.0
To read and upgrade Lucene 4. x indexes, you must add the lucene-backward-codecs. jar to the classpath. It is recommended to upgrade the old indexes with the IndexUpgrader tool, so you can remove the backward-codecs module from classpath.
First written in 1999 by Doug Cutting, still going strong... Apache Lucene, the full-text search library, has operated and been maintained for more than 20 years and for many developers is an integral part of their website and application builds.
Lucene Core is a Java library providing powerful indexing and search features, as well as spellchecking, hit highlighting and advanced analysis/tokenization capabilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With