lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmes...@apache.org
Subject svn commit: r326609 - /lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java
Date Wed, 19 Oct 2005 16:54:51 GMT
Author: bmesser
Date: Wed Oct 19 09:54:46 2005
New Revision: 326609

URL: http://svn.apache.org/viewcvs?rev=326609&view=rev
Log:
check for storeOffsetWithTermVector and storePositionWithTermVector. See Bug#LUCENE-455

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java?rev=326609&r1=326608&r2=326609&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/FieldsReader.java Wed Oct 19 09:54:46
2005
@@ -92,6 +92,27 @@
         else
           index = Field.Index.NO;
         
+        Field.TermVector termVector = null;
+        if (fi.storeTermVector) {
+          if (fi.storeOffsetWithTermVector) {
+            if (fi.storePositionWithTermVector) {
+              termVector = Field.TermVector.WITH_POSITIONS_OFFSETS;
+            }
+            else {
+              termVector = Field.TermVector.WITH_OFFSETS;
+            }
+          }
+          else if (fi.storePositionWithTermVector) {
+            termVector = Field.TermVector.WITH_POSITIONS;
+          }
+          else {
+            termVector = Field.TermVector.YES;
+          }
+        }
+        else {
+          termVector = Field.TermVector.NO;
+        }
+        
         if (compressed) {
           store = Field.Store.COMPRESS;
           final byte[] b = new byte[fieldsStream.readVInt()];
@@ -100,14 +121,14 @@
               new String(uncompress(b), "UTF-8"), // uncompress the value and add as string
               store,
               index,
-              fi.storeTermVector ? Field.TermVector.YES : Field.TermVector.NO));
+              termVector));
         }
         else
           doc.add(new Field(fi.name,      // name
                 fieldsStream.readString(), // read value
                 store,
                 index,
-                fi.storeTermVector ? Field.TermVector.YES : Field.TermVector.NO));
+                termVector));
       }
     }
 



Mime
View raw message