Index: CHANGES.txt =================================================================== --- CHANGES.txt (revision 1001906) +++ CHANGES.txt (working copy) @@ -40,8 +40,15 @@ if the writer had just committed (Nikolay Zamosenchuk via Mike McCandless) * LUCENE-2650: Added extra safety to MMapIndexInput clones to prevent accessing - an unmapped buffer if the input is closed (Mike McCandless, Uwe Schindler, Robert Muir) + an unmapped buffer if the input is closed (Mike McCandless, Uwe Schindler, Robert Muir) +New features + +* LUCENE-2675: Add support for Lucene 3.0 stored field files also in 2.9. + The file format did not change, only the version number was upgraded to mark + segments that have no compression. FieldsWriter still only writes 2.9 segments + as they could contain compressed fields. (Uwe Schindler) + Documentation * LUCENE-2239: Documented limitations in NIOFSDirectory and MMapDirectory due to Index: src/java/org/apache/lucene/index/FieldsReader.java =================================================================== --- src/java/org/apache/lucene/index/FieldsReader.java (revision 1001906) +++ src/java/org/apache/lucene/index/FieldsReader.java (working copy) @@ -113,7 +113,9 @@ else format = firstInt; - if (format > FieldsWriter.FORMAT_CURRENT) + if (format > FieldsWriter.FORMAT_CURRENT + /* extra support for Lucene 3.0 indexes: */ && format != FieldsWriter.FORMAT_LUCENE_3_0_NO_COMPRESSED_FIELDS + ) throw new CorruptIndexException("Incompatible format version: " + format + " expected " + FieldsWriter.FORMAT_CURRENT + " or lower"); Index: src/java/org/apache/lucene/index/FieldsWriter.java =================================================================== --- src/java/org/apache/lucene/index/FieldsWriter.java (revision 1001906) +++ src/java/org/apache/lucene/index/FieldsWriter.java (working copy) @@ -38,6 +38,12 @@ // Changed strings to UTF8 static final int FORMAT_VERSION_UTF8_LENGTH_IN_BYTES = 1; + + // Lucene 3.0: Removal of compressed fields: This is only to provide compatibility with 3.0-created indexes + // new segments always use the FORMAT_CURRENT. As the index format did not change in 3.0, only + // new stored field files that no longer support compression are marked as such to optimize merging. + // But 2.9 can still read them. + static final int FORMAT_LUCENE_3_0_NO_COMPRESSED_FIELDS = 2; // NOTE: if you introduce a new format, make it 1 higher // than the current one, and always change this if you Index: src/test/org/apache/lucene/index/index.30.cfs.zip =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: src\test\org\apache\lucene\index\index.30.cfs.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: src/test/org/apache/lucene/index/index.30.nocfs.zip =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Property changes on: src\test\org\apache\lucene\index\index.30.nocfs.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Index: src/test/org/apache/lucene/index/TestBackwardsCompatibility.java =================================================================== --- src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (revision 1001906) +++ src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (working copy) @@ -128,6 +128,8 @@ "23.nocfs", "24.cfs", "24.nocfs", + "30.cfs", + "30.nocfs", }; public void testOptimizeOldIndex() throws IOException {