lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1436472 - in /lucene/dev/branches/lucene4547/lucene/core/src: java/org/apache/lucene/index/MultiDocValues.java test/org/apache/lucene/search/TestSearchAfter.java
Date Mon, 21 Jan 2013 16:40:03 GMT
Author: rmuir
Date: Mon Jan 21 16:40:02 2013
New Revision: 1436472

URL: http://svn.apache.org/viewvc?rev=1436472&view=rev
Log:
make MultiDocValues.getSorted more efficient

Modified:
    lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
    lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java

Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java?rev=1436472&r1=1436471&r2=1436472&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/index/MultiDocValues.java
Mon Jan 21 16:40:02 2013
@@ -22,6 +22,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.lucene.codecs.Codec;
+import org.apache.lucene.index.FieldInfo.DocValuesType;
 import org.apache.lucene.index.IndexReader.ReaderClosedListener;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.RAMDirectory;
@@ -174,6 +175,9 @@ public class MultiDocValues {
       config.setCodec(Codec.forName("SimpleText"));
       IndexWriter writer = new IndexWriter(scratch, config);
       List<AtomicReader> newLeaves = new ArrayList<AtomicReader>();
+      // fake up fieldinfos
+      FieldInfo fi = new FieldInfo(field, false, 0, false, false, false, null, DocValuesType.SORTED,
null, null);
+      final FieldInfos fis = new FieldInfos(new FieldInfo[] { fi });
       for (AtomicReaderContext ctx : leaves) {
         final AtomicReader a = ctx.reader();
         newLeaves.add(new FilterAtomicReader(a) {
@@ -189,6 +193,22 @@ public class MultiDocValues {
           public boolean hasDeletions() {
             return false; // lie
           }
+          @Override
+          public FieldInfos getFieldInfos() {
+            return fis;
+          }
+          @Override
+          public Fields getTermVectors(int docID) throws IOException {
+            return null; // lie
+          }
+          @Override
+          public void document(int docID, StoredFieldVisitor visitor) throws IOException
{
+            // lie
+          }
+          @Override
+          public Fields fields() throws IOException {
+            return null; // lie
+          }
         });
       }
       writer.addIndexes(newLeaves.toArray(new AtomicReader[0]));

Modified: lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java?rev=1436472&r1=1436471&r2=1436472&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java
(original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/search/TestSearchAfter.java
Mon Jan 21 16:40:02 2013
@@ -41,7 +41,6 @@ import org.apache.lucene.util._TestUtil;
 /**
  * Tests IndexSearcher's searchAfter() method
  */
-// nocommit fail w/ OOME?: ant test  -Dtestcase=TestSearchAfter -Dtests.method=testQueries
-Dtests.seed=98B4DA915983D1AE -Dtests.slow=true -Dtests.locale=sr -Dtests.timezone=Etc/GMT+2
-Dtests.file.encoding=UTF-8
 public class TestSearchAfter extends LuceneTestCase {
   private Directory dir;
   private IndexReader reader;



Mime
View raw message