ishayle
ishayle

Reputation: 365

How to use lucene-backward-codecs?

I'm trying to make Solr 7.3.1 read a 5.3.1 index, I'm trying to use lucene-backward-codecs jar file, but i cant make it work -

Caused by: org.apache.lucene.index.IndexFormatTooOldException: Format version is not supported (resource BufferedChecksumIndexInput(MMapIndexInput(path="C:\ProgramFilesVaronis\DatAnswers\solr\cloud\node1\documents_shard1_replica_n1\data\index\segments_a"))): this index is too old (version: 5.3.1). This version of Lucene only supports indexes created with release 6.0 and later

Which version of lucene-backward-codecs do i need? Where in Solr do i need to put them in order to make it work?

Upvotes: 0

Views: 3808

Answers (1)

MatsLindh
MatsLindh

Reputation: 52912

The backwards codec files are used with the IndexUpgrader tool. It's also used internally in Solr to read the old index files automagically and is already loaded.

The Lucene distribution includes a tool that upgrades an index from previous Lucene versions to the current file format.

java -cp lucene-core-7.5.0.jar:lucene-backward-codecs-7.5.0.jar org.apache.lucene.index.IndexUpgrader [-delete-prior-commits] [-verbose] /path/to/index

But this is the issue you're probably running into - the backwards compatibility only spans one major release. So Solr 7 can read index files from Solr 6, but not from Solr 5.

To fix this you can download Solr 6.x, run the IndexUpgrader tool, then open that index in Solr 7.5.

There's also a tool that downloads the required jars (upgradeindex.sh) and performs an automagic upgrade from each version for you.

Upvotes: 2

Related Questions