diff --git a/CHANGES.txt b/CHANGES.txt index 82e5ed5c559..f73ae4b1ba6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -105,6 +105,11 @@ Bug fixes 14. LUCENE-992: Fixed IndexWriter.updateDocument to be atomic again (this was broken by LUCENE-843). (Ning Li via Mike McCandless) +15. LUCENE-1008: Fixed corruption case when document with no term + vector fields is added after documents with term vector fields. + This bug was introduced with LUCENE-843. (Grant Ingersoll via + Mike McCandless) + New features 1. LUCENE-906: Elision filter for French. diff --git a/src/java/org/apache/lucene/index/DocumentsWriter.java b/src/java/org/apache/lucene/index/DocumentsWriter.java index 4e2e112e450..d3a191bcf12 100644 --- a/src/java/org/apache/lucene/index/DocumentsWriter.java +++ b/src/java/org/apache/lucene/index/DocumentsWriter.java @@ -552,8 +552,8 @@ final class DocumentsWriter { // Append term vectors to the real outputs: if (tvx != null) { tvx.writeLong(tvd.getFilePointer()); + tvd.writeVInt(numVectorFields); if (numVectorFields > 0) { - tvd.writeVInt(numVectorFields); for(int i=0;i