You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2013/10/24 19:55:50 UTC

svn commit: r1535456 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/suggest/ lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentExpressionDictionaryTest.java

Author: mikemccand
Date: Thu Oct 24 17:55:49 2013
New Revision: 1535456

URL: http://svn.apache.org/r1535456
Log:
LUCENE-5305: wrap reader as slow composite reader, until we fix DocumentExpressionDictionary to accept composite readers

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/suggest/   (props changed)
    lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentExpressionDictionaryTest.java

Modified: lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentExpressionDictionaryTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentExpressionDictionaryTest.java?rev=1535456&r1=1535455&r2=1535456&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentExpressionDictionaryTest.java (original)
+++ lucene/dev/branches/branch_4x/lucene/suggest/src/test/org/apache/lucene/search/suggest/DocumentExpressionDictionaryTest.java Thu Oct 24 17:55:49 2013
@@ -36,6 +36,7 @@ import org.apache.lucene.index.Directory
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.RandomIndexWriter;
+import org.apache.lucene.index.SlowCompositeReaderWrapper;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.SortField;
 import org.apache.lucene.search.spell.Dictionary;
@@ -85,7 +86,10 @@ public class DocumentExpressionDictionar
     }
     writer.commit();
     writer.close();
-    IndexReader ir = DirectoryReader.open(dir);
+    // TODO: once we fix DocumentExpressionDictionary to
+    // accept readers with more than one segment, we can
+    // remove this wrapping:
+    IndexReader ir = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir));
     Set<SortField> sortFields = new HashSet<SortField>(); 
     sortFields.add(new SortField(WEIGHT_FIELD_NAME_1, SortField.Type.LONG));
     sortFields.add(new SortField(WEIGHT_FIELD_NAME_2, SortField.Type.LONG));
@@ -119,7 +123,10 @@ public class DocumentExpressionDictionar
     }
     writer.commit();
     writer.close();
-    IndexReader ir = DirectoryReader.open(dir);
+    // TODO: once we fix DocumentExpressionDictionary to
+    // accept readers with more than one segment, we can
+    // remove this wrapping:
+    IndexReader ir = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir));
     Set<SortField> sortFields = new HashSet<SortField>(); 
     sortFields.add(new SortField(WEIGHT_FIELD_NAME_1, SortField.Type.LONG));
     sortFields.add(new SortField(WEIGHT_FIELD_NAME_2, SortField.Type.LONG));
@@ -173,7 +180,10 @@ public class DocumentExpressionDictionar
       assertTrue(null!=docs.remove(termToDel));
     }
     
-    IndexReader ir = DirectoryReader.open(dir);
+    // TODO: once we fix DocumentExpressionDictionary to
+    // accept readers with more than one segment, we can
+    // remove this wrapping:
+    IndexReader ir = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(dir));
     assertEquals(ir.numDocs(), docs.size());
     Set<SortField> sortFields = new HashSet<SortField>(); 
     sortFields.add(new SortField(WEIGHT_FIELD_NAME_1, SortField.Type.LONG));