lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r741838 - in /lucene/java/trunk/src: java/org/apache/lucene/index/SegmentReader.java test/org/apache/lucene/index/TestIndexReaderReopen.java
Date Sat, 07 Feb 2009 03:30:24 GMT
Author: yonik
Date: Sat Feb  7 03:30:24 2009
New Revision: 741838

URL: http://svn.apache.org/viewvc?rev=741838&view=rev
Log:
LUCENE-1314: fix reopen bug wrt fields that don't have norms

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java?rev=741838&r1=741837&r2=741838&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentReader.java Sat Feb  7 03:30:24
2009
@@ -722,7 +722,8 @@
         if (doClone || !fieldNormsChanged[i]) {
           final String curField = fieldInfos.fieldInfo(i).name;
           Norm norm = (Norm) this.norms.get(curField);
-          clone.norms.put(curField, norm.clone());
+          if (norm != null)
+            clone.norms.put(curField, norm.clone());
         }
       }
       

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java?rev=741838&r1=741837&r2=741838&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java Sat Feb
 7 03:30:24 2009
@@ -168,6 +168,8 @@
         for (int j=0; j<M; j++) {
           Document doc = new Document();
           doc.add(new Field("id", i+"_"+j, Store.YES, Index.NOT_ANALYZED));
+          doc.add(new Field("id2", i+"_"+j, Store.YES, Index.NOT_ANALYZED_NO_NORMS));
+          doc.add(new Field("id3", i+"_"+j, Store.YES, Index.NO));
           iwriter.addDocument(doc);
           if (i>0) {
             int k = i-1;
@@ -959,6 +961,8 @@
     sb.append("a");
     sb.append(n);
     doc.add(new Field("field1", sb.toString(), Store.YES, Index.ANALYZED));
+    doc.add(new Field("fielda", sb.toString(), Store.YES, Index.NOT_ANALYZED_NO_NORMS));
+    doc.add(new Field("fieldb", sb.toString(), Store.YES, Index.NO));
     sb.append(" b");
     sb.append(n);
     for (int i = 1; i < numFields; i++) {



Mime
View raw message