lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r619637 - in /lucene/java/trunk: contrib/memory/src/test/org/apache/lucene/index/memory/ src/demo/org/apache/lucene/demo/ src/java/org/apache/lucene/index/ src/test/org/apache/lucene/ src/test/org/apache/lucene/index/
Date Thu, 07 Feb 2008 21:07:37 GMT
Author: mikemccand
Date: Thu Feb  7 13:07:35 2008
New Revision: 619637

URL: http://svn.apache.org/viewvc?rev=619637&view=rev
Log:
LUCENE-1084: fix more test cases to use user-defined MaxFieldLength ctor for IndexWriter

Modified:
    lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
    lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexHTML.java
    lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java
    lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java
    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java

Modified: lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=619637&r1=619636&r2=619637&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
(original)
+++ lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
Thu Feb  7 13:07:35 2008
@@ -385,8 +385,7 @@
     RAMDirectory dir = new RAMDirectory();    
     IndexWriter writer = null;
     try {
-      writer = new IndexWriter(dir, analyzer, true);
-      writer.setMaxFieldLength(Integer.MAX_VALUE);
+      writer = new IndexWriter(dir, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
       writer.addDocument(doc);
       writer.optimize();
       return dir;

Modified: lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexHTML.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexHTML.java?rev=619637&r1=619636&r2=619637&view=diff
==============================================================================
--- lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexHTML.java (original)
+++ lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexHTML.java Thu Feb  7 13:07:35 2008
@@ -69,8 +69,7 @@
         indexDocs(root, index, create);
       }
       writer = new IndexWriter(index, new StandardAnalyzer(), create, 
-                               IndexWriter.MaxFieldLength.LIMITED);
-      writer.setMaxFieldLength(1000000);
+                               new IndexWriter.MaxFieldLength(1000000));
       indexDocs(root, index, create);		  // add new docs
 
       System.out.println("Optimizing index...");

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java?rev=619637&r1=619636&r2=619637&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/IndexModifier.java Thu Feb  7 13:07:35
2008
@@ -201,7 +201,7 @@
         indexReader.close();
         indexReader = null;
       }
-      indexWriter = new IndexWriter(directory, analyzer, false, IndexWriter.MaxFieldLength.LIMITED);
+      indexWriter = new IndexWriter(directory, analyzer, false, new IndexWriter.MaxFieldLength(maxFieldLength));
       // IndexModifier cannot use ConcurrentMergeScheduler
       // because it synchronizes on the directory which can
       // cause deadlock
@@ -210,7 +210,6 @@
       indexWriter.setUseCompoundFile(useCompoundFile);
       if (maxBufferedDocs != IndexWriter.DISABLE_AUTO_FLUSH)
         indexWriter.setMaxBufferedDocs(maxBufferedDocs);
-      indexWriter.setMaxFieldLength(maxFieldLength);
       indexWriter.setMergeFactor(mergeFactor);
     }
   }

Modified: lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java?rev=619637&r1=619636&r2=619637&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java Thu Feb  7 13:07:35 2008
@@ -51,8 +51,7 @@
     // if one exists):
     //Directory directory = FSDirectory.getDirectory("/tmp/testindex", true);
     IndexWriter iwriter = new IndexWriter(directory, analyzer, true,
-                                          IndexWriter.MaxFieldLength.LIMITED);
-    iwriter.setMaxFieldLength(25000);
+                                          new IndexWriter.MaxFieldLength(25000));
     Document doc = new Document();
     String text = "This is the text to be indexed.";
     doc.add(new Field("fieldname", text, Field.Store.YES,

Modified: lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=619637&r1=619636&r2=619637&view=diff
==============================================================================
--- lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java Thu Feb  7 13:07:35
2008
@@ -1478,9 +1478,8 @@
 
     public void testHighFreqTerm() throws IOException {
       RAMDirectory dir = new RAMDirectory();      
-      IndexWriter writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
+      IndexWriter writer  = new IndexWriter(dir, new WhitespaceAnalyzer(), true, new IndexWriter.MaxFieldLength(100000000));
       writer.setRAMBufferSizeMB(0.01);
-      writer.setMaxFieldLength(100000000);
       // Massive doc that has 128 K a's
       StringBuffer b = new StringBuffer(1024*1024);
       for(int i=0;i<4096;i++) {



Mime
View raw message