Index: src/test/org/apache/lucene/index/TestDocumentWriter.java
===================================================================
--- src/test/org/apache/lucene/index/TestDocumentWriter.java	(révision 489679)
+++ src/test/org/apache/lucene/index/TestDocumentWriter.java	(copie de travail)
@@ -17,18 +17,25 @@
  * limitations under the License.
  */
 
+import java.io.IOException;
+import java.io.Reader;
+
 import junit.framework.TestCase;
+
 import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.WhitespaceAnalyzer;
-import org.apache.lucene.analysis.TokenStream;
 import org.apache.lucene.analysis.WhitespaceTokenizer;
-import org.apache.lucene.document.*;
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.document.Fieldable;
+import org.apache.lucene.document.Field.Index;
+import org.apache.lucene.document.Field.Store;
+import org.apache.lucene.document.Field.TermVector;
 import org.apache.lucene.search.Similarity;
 import org.apache.lucene.store.RAMDirectory;
 
-import java.io.Reader;
-import java.io.IOException;
-
 public class TestDocumentWriter extends TestCase {
   private RAMDirectory dir;
 
@@ -124,4 +131,20 @@
     assertEquals(0, termPositions.nextPosition());
     assertEquals(502, termPositions.nextPosition());
   }
+
+  /**
+   * Test that adding two fields with the same name, but with different indexing
+   * 
+   * @throws Exception
+   */
+  public void testTermVector() throws Exception {
+    Document doc = new Document();
+    doc.add(new Field("f1", "v1", Store.YES, Index.TOKENIZED, TermVector.WITH_POSITIONS_OFFSETS));
+    doc.add(new Field("f1", "v2", Store.YES, Index.TOKENIZED, TermVector.NO));
+
+    RAMDirectory ram = new RAMDirectory();
+    IndexWriter writer = new IndexWriter(ram, new StandardAnalyzer(), true);
+    writer.addDocument(doc);
+    writer.close();
+  }
 }
Index: src/java/org/apache/lucene/index/DocumentWriter.java
===================================================================
--- src/java/org/apache/lucene/index/DocumentWriter.java	(révision 489679)
+++ src/java/org/apache/lucene/index/DocumentWriter.java	(copie de travail)
@@ -133,17 +133,18 @@
     while (fieldIterator.hasNext()) {
       Fieldable field = (Fieldable) fieldIterator.next();
       String fieldName = field.name();
-      int fieldNumber = fieldInfos.fieldNumber(fieldName);
+      FieldInfo filedInfo = fieldInfos.fieldInfo(fieldName);
+      int fieldNumber = filedInfo.number;
 
       int length = fieldLengths[fieldNumber];     // length of field
       int position = fieldPositions[fieldNumber]; // position in field
       if (length>0) position+=analyzer.getPositionIncrementGap(fieldName);
       int offset = fieldOffsets[fieldNumber];       // offset field
 
-      if (field.isIndexed()) {
+      if (filedInfo.isIndexed) {
         if (!field.isTokenized()) {		  // un-tokenized field
           String stringValue = field.stringValue();
-          if(field.isStoreOffsetWithTermVector())
+          if(filedInfo.storeOffsetWithTermVector)
             addPosition(fieldName, stringValue, position++, new TermVectorOffsetInfo(offset, offset + stringValue.length()));
           else
             addPosition(fieldName, stringValue, position++, null);
@@ -167,7 +168,7 @@
             for (Token t = stream.next(); t != null; t = stream.next()) {
               position += (t.getPositionIncrement() - 1);
               
-              if(field.isStoreOffsetWithTermVector())
+              if(filedInfo.storeOffsetWithTermVector)
                 addPosition(fieldName, t.termText(), position++, new TermVectorOffsetInfo(offset + t.startOffset(), offset + t.endOffset()));
               else
                 addPosition(fieldName, t.termText(), position++, null);
