You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by tsuraan <ts...@gmail.com> on 2026/08/19 14:52:35 UTC

IndexUpgrader not upgrading indices?

I have indices that were written with Lucene 9.x and upgraded using
IndexUpgrader to 10.x (along with the code that uses them). When
attempting to add new data to the upgraded indices (using the
IndexWriter.addIndexes method), I'm getting this exception:

```
java.lang.IllegalArgumentException: Cannot use addIndexes(Directory)
with indexes that have been created by a different Lucene version. The
current index was generated by Lucene 9 while one of the directories
contains an index that was generated with Lucene 10
0: org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:3050)
...
```

Do I have to do something more than IndexUpgrader to be able to use my
old indices with new Lucene? I've attached a full verbose log of an
IndexUpgrader run, and it looks like it was successful, but maybe I'm
missing something. Also the full contents of that angry Directory are
pasted in below. Thanks for any help!

-rw-rw-rw- 1 root root    0 Jul  1 00:02 write.lock
-rw-rw-rw- 1 root root 4.6K Aug 17 19:21 _hi7.fdx
-rw-rw-rw- 1 root root 9.1M Aug 17 19:21 _hi7.fdt
-rw-rw-rw- 1 root root  160 Aug 17 19:21 _hi7.fdm
-rw-rw-rw- 1 root root  607 Aug 17 19:21 _hi7.nvm
-rw-rw-rw- 1 root root 771K Aug 17 19:21 _hi7.nvd
-rw-rw-rw- 1 root root 1.7K Aug 17 19:21 _hi7_Lucene104_0.tmd
-rw-rw-rw- 1 root root 492K Aug 17 19:21 _hi7_Lucene104_0.tip
-rw-rw-rw- 1 root root  68M Aug 17 19:21 _hi7_Lucene104_0.tim
-rw-rw-rw- 1 root root  112 Aug 17 19:21 _hi7_Lucene104_0.psm
-rw-rw-rw- 1 root root 121M Aug 17 19:21 _hi7_Lucene104_0.pos
-rw-rw-rw- 1 root root  40M Aug 17 19:21 _hi7_Lucene104_0.doc
-rw-rw-rw- 1 root root 1.9K Aug 17 19:21 _hi7_Lucene90_0.dvm
-rw-rw-rw- 1 root root 3.0M Aug 17 19:21 _hi7_Lucene90_0.dvd
-rw-rw-rw- 1 root root  210 Aug 17 19:21 _hi7.kdm
-rw-rw-rw- 1 root root 1.1K Aug 17 19:21 _hi7.kdi
-rw-rw-rw- 1 root root 271K Aug 17 19:21 _hi7.kdd
-rw-rw-rw- 1 root root 4.6K Aug 17 19:21 _hi7.fnm
-rw-rw-rw- 1 root root  594 Aug 17 19:21 _hi7.si
-rw-rw-rw- 1 root root 1.4K Aug 17 19:22 _hi8_Lucene104_0.tmd
-rw-rw-rw- 1 root root  557 Aug 17 19:22 _hi8.si
-rw-rw-rw- 1 root root  137 Aug 17 19:22 _hi8.nvd
-rw-rw-rw- 1 root root  471 Aug 17 19:22 _hi8_Lucene90_0.dvd
-rw-rw-rw- 1 root root  112 Aug 17 19:22 _hi8_Lucene104_0.psm
-rw-rw-rw- 1 root root 2.6K Aug 17 19:22 _hi8_Lucene104_0.pos
-rw-rw-rw- 1 root root  525 Aug 17 19:22 _hi8_Lucene104_0.tip
-rw-rw-rw- 1 root root  607 Aug 17 19:22 _hi8.nvm
-rw-rw-rw- 1 root root   98 Aug 17 19:22 _hi8.kdd
-rw-rw-rw- 1 root root 4.6K Aug 17 19:22 _hi8.fnm
-rw-rw-rw- 1 root root  402 Aug 17 19:22 _hi8_Lucene104_0.doc
-rw-rw-rw- 1 root root   69 Aug 17 19:22 _hi8.kdi
-rw-rw-rw- 1 root root 1.9K Aug 17 19:22 _hi8_Lucene90_0.dvm
-rw-rw-rw- 1 root root 9.4K Aug 17 19:22 _hi8_Lucene104_0.tim
-rw-rw-rw- 1 root root  157 Aug 17 19:22 _hi8.fdm
-rw-rw-rw- 1 root root  200 Aug 17 19:22 _hi8.kdm
-rw-rw-rw- 1 root root   64 Aug 17 19:22 _hi8.fdx
-rw-rw-rw- 1 root root  798 Aug 17 19:22 _hi8.fdt
-rw-r--r-- 1 root root  306 Aug 19 14:18 segments_eq7


Re: IndexUpgrader not upgrading indices?

Posted by tsuraan <ts...@gmail.com>.
> I have indices that were written with Lucene 9.x and upgraded using
> IndexUpgrader to 10.x (along with the code that uses them). When
> attempting to add new data to the upgraded indices (using the
> IndexWriter.addIndexes method), I'm getting this exception:

So I found <https://github.com/apache/lucene/issues/9311>, and it
looks like Lucene major upgrades are expected to be followed by full
re-indexing? The IndexUpgrader allows searching on old indices, but
isn't a tool for really upgrading indices to be fully used by new
Lucene releases? That's from 2018, but I'm not finding anything newer
to contradict it. Updates would be very welcome though.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org