From 7d03a8bff7ef533c6ae20423a8d8abe820ca1468 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Thu, 31 Jan 2008 11:23:38 +0000 Subject: [PATCH] LUCENE-1084: fixing a few more IndexWriter instantiations to not use deprecated ctors git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@617104 13f79535-47bb-0310-9956-ffa450edef68 --- src/test/org/apache/lucene/SearchTest.java | 2 +- .../org/apache/lucene/ThreadSafetyTest.java | 4 +- .../apache/lucene/index/TestIndexWriter.java | 142 +++++++++--------- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/test/org/apache/lucene/SearchTest.java b/src/test/org/apache/lucene/SearchTest.java index ea8f5f11100..f1b2db063b7 100644 --- a/src/test/org/apache/lucene/SearchTest.java +++ b/src/test/org/apache/lucene/SearchTest.java @@ -31,7 +31,7 @@ class SearchTest { try { Directory directory = new RAMDirectory(); Analyzer analyzer = new SimpleAnalyzer(); - IndexWriter writer = new IndexWriter(directory, analyzer, true); + IndexWriter writer = new IndexWriter(directory, analyzer, true, IndexWriter.MaxFieldLength.LIMITED); String[] docs = { "a b c d e", diff --git a/src/test/org/apache/lucene/ThreadSafetyTest.java b/src/test/org/apache/lucene/ThreadSafetyTest.java index c9fade56da2..0fa304a6f74 100644 --- a/src/test/org/apache/lucene/ThreadSafetyTest.java +++ b/src/test/org/apache/lucene/ThreadSafetyTest.java @@ -68,7 +68,7 @@ class ThreadSafetyTest { if (i%reopenInterval == 0) { writer.close(); - writer = new IndexWriter("index", ANALYZER, false); + writer = new IndexWriter("index", ANALYZER, false, IndexWriter.MaxFieldLength.LIMITED); } } @@ -142,7 +142,7 @@ class ThreadSafetyTest { IndexReader.unlock(FSDirectory.getDirectory(indexDir)); if (!readOnly) { - IndexWriter writer = new IndexWriter(indexDir, ANALYZER, !add); + IndexWriter writer = new IndexWriter(indexDir, ANALYZER, !add, IndexWriter.MaxFieldLength.LIMITED); Thread indexerThread = new IndexerThread(writer); indexerThread.start(); diff --git a/src/test/org/apache/lucene/index/TestIndexWriter.java b/src/test/org/apache/lucene/index/TestIndexWriter.java index accd36d31f2..456cfa6b990 100644 --- a/src/test/org/apache/lucene/index/TestIndexWriter.java +++ b/src/test/org/apache/lucene/index/TestIndexWriter.java @@ -69,7 +69,7 @@ public class TestIndexWriter extends LuceneTestCase IndexWriter.setDefaultWriteLockTimeout(2000); assertEquals(2000, IndexWriter.getDefaultWriteLockTimeout()); - writer = new IndexWriter(dir, new WhitespaceAnalyzer()); + writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED); IndexWriter.setDefaultWriteLockTimeout(1000); @@ -88,7 +88,7 @@ public class TestIndexWriter extends LuceneTestCase reader.close(); // test doc count before segments are merged/index is optimized - writer = new IndexWriter(dir, new WhitespaceAnalyzer()); + writer = new IndexWriter(dir, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED); assertEquals(100, writer.docCount()); writer.close(); @@ -98,7 +98,7 @@ public class TestIndexWriter extends LuceneTestCase reader.close(); // optimize the index and check that the new doc count is correct - writer = new IndexWriter(dir, true, new WhitespaceAnalyzer()); + writer = new IndexWriter(dir, true, new WhitespaceAnalyzer(), IndexWriter.MaxFieldLength.LIMITED); writer.optimize(); assertEquals(60, writer.docCount()); writer.close(); @@ -111,7 +111,7 @@ public class TestIndexWriter extends LuceneTestCase // make sure opening a new index for create over // this existing one works correctly: - writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true); + writer = new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED); assertEquals(0, writer.docCount()); writer.close(); } @@ -153,7 +153,7 @@ public class TestIndexWriter extends LuceneTestCase long inputDiskUsage = 0; for(int i=0;i