Hi Rahul, Thanks for starting this interesting discussion. I was initially thinking that this API potentially allows upgrading "indexCreatedVersionMajor" via the merge process after rewriting all the segments, but I guess the SegmentInfo "minVersion" is the min across all segments during the merge process?
So, I am wondering if there is any way to end up in the 2nd scenario, without having deleted all the documents first? Thanks Ankit On Sat, Apr 19, 2025 at 9:17 AM Rahul Goswami <rahul196...@gmail.com> wrote: > Hello, > Today even after all documents in an index are deleted via an API call, > reindexing still doesn't change the "indexCreatedVersionMajor" property > value in SegmentInfos. Hence even after complete reindexing, an upgrade > path X--> X+1 --> X+2 is still not possible as we end up with an > IndexFormatTooOldException. > > Requesting an API (on IndexWriter?) which can reset this property (upon a > new commit) to the current Lucene version if: > 1) No more live docs present > OR > 2) If all SegmentInfo in the index have a "minVersion" AND "version" stamp > of the latest version , but SegmentInfos has an older > "indexCreatedVersionMajor". > > This will help users a LOT since they can now interact with the index > purely via API without needing manual deletion and also help open up a > legitimate path to upgrade when an index doesn't HAVE to be repopulated > from the source. > > If there is agreement, I am happy to pick this up and submit a PR. > > Thanks, > Rahul Goswami > > >