diff --git a/lucene/src/java/org/apache/lucene/index/CheckIndex.java b/lucene/src/java/org/apache/lucene/index/CheckIndex.java index 6b075d8b73d..d148718421f 100644 --- a/lucene/src/java/org/apache/lucene/index/CheckIndex.java +++ b/lucene/src/java/org/apache/lucene/index/CheckIndex.java @@ -371,10 +371,10 @@ public class CheckIndex { sFormat = "FORMAT_DIAGNOSTICS [Lucene 2.9]"; } else if (format == DefaultSegmentInfosWriter.FORMAT_HAS_VECTORS) { sFormat = "FORMAT_HAS_VECTORS [Lucene 3.1]"; - } else if (format == DefaultSegmentInfosWriter.FORMAT_3_1) { - sFormat = "FORMAT_3_1 [Lucene 3.1]"; - } else if (format == DefaultSegmentInfosWriter.FORMAT_4_0) { - sFormat = "FORMAT_4_0 [Lucene 4.0]"; + } else if (format == DefaultSegmentInfosWriter.FORMAT_SEGMENT_RECORDS_VERSION) { + sFormat = "FORMAT_SEGMENT_RECORDS_VERSION [Lucene 3.1+]"; + } else if (format == DefaultSegmentInfosWriter.FORMAT_FLEX) { + sFormat = "FORMAT_FLEX [Lucene 4.0+]"; } else if (format == DefaultSegmentInfosWriter.FORMAT_CURRENT) { throw new RuntimeException("BUG: You should update this tool!"); } else if (format < DefaultSegmentInfosWriter.FORMAT_CURRENT) { diff --git a/lucene/src/java/org/apache/lucene/index/SegmentInfo.java b/lucene/src/java/org/apache/lucene/index/SegmentInfo.java index 661b4755498..a546f6f06b6 100644 --- a/lucene/src/java/org/apache/lucene/index/SegmentInfo.java +++ b/lucene/src/java/org/apache/lucene/index/SegmentInfo.java @@ -178,7 +178,7 @@ public final class SegmentInfo implements Cloneable { */ public SegmentInfo(Directory dir, int format, IndexInput input, CodecProvider codecs) throws IOException { this.dir = dir; - if (format <= DefaultSegmentInfosWriter.FORMAT_3_1) { + if (format <= DefaultSegmentInfosWriter.FORMAT_SEGMENT_RECORDS_VERSION) { version = input.readString(); } name = input.readString(); @@ -193,7 +193,7 @@ public final class SegmentInfo implements Cloneable { docStoreIsCompoundFile = false; } - if (format > DefaultSegmentInfosWriter.FORMAT_4_0) { + if (format > DefaultSegmentInfosWriter.FORMAT_FLEX) { // pre-4.0 indexes write a byte if there is a single norms file byte b = input.readByte(); assert 1 == b; @@ -206,7 +206,7 @@ public final class SegmentInfo implements Cloneable { normGen = new HashMap(); for(int j=0;j files = writer.getIndexFileNames(); for (String string : files) { @@ -485,7 +485,7 @@ public class TestGlobalFieldNumbers extends LuceneTestCase { writer.addDocument(d); writer.prepareCommit(); // the fnx file should still be under control of the SIS - assertTrue(DefaultSegmentInfosWriter.FORMAT_4_0 < segmentInfos.getFormat()); + assertTrue(DefaultSegmentInfosWriter.FORMAT_FLEX < segmentInfos.getFormat()); assertEquals(0, segmentInfos.getLastGlobalFieldMapVersion()); assertEquals(1, segmentInfos.getGlobalFieldMapVersion()); files = writer.getIndexFileNames(); @@ -496,7 +496,7 @@ public class TestGlobalFieldNumbers extends LuceneTestCase { writer.commit(); // now we should see the fnx file even if this is a 3.x segment - assertTrue(DefaultSegmentInfosWriter.FORMAT_4_0 < segmentInfos.getFormat()); + assertTrue(DefaultSegmentInfosWriter.FORMAT_FLEX < segmentInfos.getFormat()); assertEquals(1, segmentInfos.getGlobalFieldMapVersion()); assertEquals(1, segmentInfos.getLastGlobalFieldMapVersion()); files = writer.getIndexFileNames();