lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: svn commit: r921480 [1/8] - in /lucene/java/trunk: ./ contrib/analyzers/common/src/test/org/apache/lucene/analysis/query/ contrib/analyzers/common/src/test/org/apache/lucene/analysis/shingle/ contrib/ant/src/java/org/apache/lucene/ant/ contrib/be
Date Wed, 10 Mar 2010 18:39:54 GMT
Not a problem -- this is how the iterations work! -- par for the course...

Mike

On Wed, Mar 10, 2010 at 1:38 PM, Robert Muir <rcmuir@gmail.com> wrote:
> I'm really sorry i wasn't paying attention and didn't notice earlier,
> you did give adequate warning...
>
> On Wed, Mar 10, 2010 at 1:37 PM, Michael McCandless
> <lucene@mikemccandless.com> wrote:
>> Good question  -- I'll reopen the issue.  Let's discuss there...
>>
>> Mike
>>
>> On Wed, Mar 10, 2010 at 1:31 PM, Robert Muir <rcmuir@gmail.com> wrote:
>>> I think it would be good to discuss further about 'defaulting to
>>> WhitespaceAnalyzer' here.
>>>
>>> in my opinion the user should have to turn on their brain and decide
>>> how to index their text.
>>>
>>> On Wed, Mar 10, 2010 at 12:53 PM,  <mikemccand@apache.org> wrote:
>>>> Author: mikemccand
>>>> Date: Wed Mar 10 17:53:46 2010
>>>> New Revision: 921480
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=921480&view=rev
>>>> Log:
>>>> LUCENE-2294: cutover to IndexWriterConfig object for settings to IW
>>>>
>>>> Modified:
>>>>    lucene/java/trunk/CHANGES.txt
>>>>    lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java
>>>>    lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java
>>>>    lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java
>>>>    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java
>>>>    lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java
>>>>    lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
>>>>    lucene/java/trunk/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java
>>>>    lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
>>>>    lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java
>>>>    lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
>>>>    lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
>>>>    lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestEmptyIndex.java
>>>>    lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
>>>>    lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestSerialization.java
>>>>    lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java
>>>>    lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java
>>>>    lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
>>>>    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java
>>>>    lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/IndexMergeTool.java
>>>>    lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java
>>>>    lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
>>>>    lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java
>>>>    lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestTermVectorAccessor.java
>>>>    lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/ChainedFilterTest.java
>>>>    lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java
>>>>    lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java
>>>>    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/BooleanFilterTest.java
>>>>    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/DuplicateFilterTest.java
>>>>    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/FuzzyLikeThisQueryTest.java
>>>>    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/TermsFilterTest.java
>>>>    lucene/java/trunk/contrib/queries/src/test/org/apache/lucene/search/similar/TestMoreLikeThis.java
>>>>    lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQPHelper.java
>>>>    lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestMultiFieldQueryParserWrapper.java
>>>>    lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQPHelper.java
>>>>    lucene/java/trunk/contrib/queryparser/src/test/org/apache/lucene/queryParser/standard/TestQueryParserWrapper.java
>>>>    lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestRegexQuery.java
>>>>    lucene/java/trunk/contrib/regex/src/test/org/apache/lucene/search/regex/TestSpanRegexQuery.java
>>>>    lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteCachingWrapperFilter.java
>>>>    lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSearchable.java
>>>>    lucene/java/trunk/contrib/remote/src/test/org/apache/lucene/search/TestRemoteSort.java
>>>>    lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestCartesian.java
>>>>    lucene/java/trunk/contrib/spatial/src/test/org/apache/lucene/spatial/tier/TestDistance.java
>>>>    lucene/java/trunk/contrib/spellchecker/src/java/org/apache/lucene/search/spell/SpellChecker.java
>>>>    lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestLuceneDictionary.java
>>>>    lucene/java/trunk/contrib/spellchecker/src/test/org/apache/lucene/search/spell/TestSpellChecker.java
>>>>    lucene/java/trunk/contrib/surround/src/test/org/apache/lucene/queryParser/surround/query/SingleFieldTestDb.java
>>>>    lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
>>>>    lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java
>>>>    lucene/java/trunk/contrib/wordnet/src/java/org/apache/lucene/wordnet/Syns2Index.java
>>>>    lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestParser.java
>>>>    lucene/java/trunk/contrib/xml-query-parser/src/test/org/apache/lucene/xmlparser/TestQueryTemplateManager.java
>>>>    lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexFiles.java
>>>>    lucene/java/trunk/src/demo/org/apache/lucene/demo/IndexHTML.java
>>>>    lucene/java/trunk/src/java/org/apache/lucene/index/DirectoryReader.java
>>>>    lucene/java/trunk/src/java/org/apache/lucene/index/DocumentsWriter.java
>>>>    lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java
>>>>    lucene/java/trunk/src/java/org/apache/lucene/index/SegmentMerger.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/TestDemo.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/TestMergeSchedulerExternal.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/TestSearch.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/TestSearchForDuplicates.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestCachingTokenFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/analysis/TestKeywordAnalyzer.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/collation/CollationTestBase.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/document/TestBinaryDocument.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/document/TestDocument.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/DocHelper.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestAddIndexesNoOptimize.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestAtomicUpdate.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestCheckIndex.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestConcurrentMergeScheduler.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestCrash.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestDeletionPolicy.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestDirectoryReader.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestDoc.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestDocumentWriter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestFieldsReader.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestFilterIndexReader.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReader.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderClone.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderCloneNorms.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexReaderReopen.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterDelete.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterExceptions.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterLockRelease.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMergePolicy.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterMerging.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestIndexWriterReader.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyBug.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestLazyProxSkipping.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestMultiLevelSkipList.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestNRTReaderWithThreads.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestNorms.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestOmitTf.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReader.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelReaderEmptyIndex.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestParallelTermEnum.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestPayloads.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestSegmentTermEnum.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestStressIndexing2.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestTermVectorsReader.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestTermdocPerf.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestThreadedOptimize.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactionRollback.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/index/TestTransactions.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestMultiFieldQueryParser.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/queryParser/TestQueryParser.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/BaseTestRangeFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/QueryUtils.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestBoolean2.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanOr.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanPrefixQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestBooleanScorer.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestCachingWrapperFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestCustomSearcherSort.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestDateFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestDateSort.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestDisjunctionMaxQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestDocBoost.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestDocIdSet.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestElevationComparator.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestExplanations.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCache.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheRangeFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestFieldCacheTermsFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestFilteredSearch.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestFuzzyQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestMatchAllDocsQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiPhraseQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcher.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiSearcherRanking.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiTermConstantScore.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiThreadTermVectors.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestNot.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestNumericRangeQuery64.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestPhrasePrefixQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestPhraseQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestPositionIncrement.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixInBooleanQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestPrefixQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestQueryWrapperFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestScorerPerf.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestSetNorm.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestSimilarity.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestSimpleExplanations.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestSloppyPhraseQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestSort.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestSpanQueryFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeFilter.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermRangeQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermScorer.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestTermVectors.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestThreadSafe.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestTimeLimitingCollector.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestTopDocsCollector.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestTopScoreDocCollector.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/TestWildcard.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/function/FunctionTestSetup.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/payloads/PayloadHelper.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/payloads/TestPayloadNearQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/payloads/TestPayloadTermQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestBasics.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestFieldMaskingSpanQuery.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestNearSpansOrdered.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestPayloadSpans.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpans.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/search/spans/TestSpansAdvanced2.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/store/TestBufferedIndexInput.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/store/TestFileSwitchDirectory.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/store/TestLockFactory.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/store/TestRAMDirectory.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/store/TestWindowsMMap.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/util/TestFieldCacheSanityChecker.java
>>>>    lucene/java/trunk/src/test/org/apache/lucene/util/_TestUtil.java
>>>>
>>>> Modified: lucene/java/trunk/CHANGES.txt
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/CHANGES.txt?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/CHANGES.txt (original)
>>>> +++ lucene/java/trunk/CHANGES.txt Wed Mar 10 17:53:46 2010
>>>> @@ -76,6 +76,15 @@ API Changes
>>>>   use by external code. In addition it offers a matchExtension method which
>>>>   callers can use to query whether a certain file matches a certain extension.
>>>>   (Shai Erera via Mike McCandless)
>>>> +
>>>> +* LUCENE-2294: IndexWriter constructors have been deprecated in favor of a
>>>> +  single ctor which accepts IndexWriterConfig and a Directory. You can set all
>>>> +  the parameters related to IndexWriter on IndexWriterConfig. The different
>>>> +  setter/getter methods were deprecated as well. One should call
>>>> +  writer.getConfig().getXYZ() to query for a parameter XYZ.
>>>> +  Additionally, the setter/getter related to MergePolicy were deprecated as
>>>> +  well. One should interact with the MergePolicy directly.
>>>> +  (Shai Erera via Mike McCandless)
>>>>
>>>>  * LUCENE-124: Add a TopTermsBoostOnlyBooleanQueryRewrite to MultiTermQuery.
>>>>   This rewrite method is similar to TopTermsScoringBooleanQueryRewrite, but
>>>>
>>>> Modified: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java (original)
>>>> +++ lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/query/QueryAutoStopWordAnalyzerTest.java Wed Mar 10 17:53:46 2010
>>>> @@ -31,6 +31,7 @@ import org.apache.lucene.document.Docume
>>>>  import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>>  import org.apache.lucene.queryParser.ParseException;
>>>>  import org.apache.lucene.queryParser.QueryParser;
>>>> @@ -51,7 +52,7 @@ public class QueryAutoStopWordAnalyzerTe
>>>>     super.setUp();
>>>>     dir = new RAMDirectory();
>>>>     appAnalyzer = new WhitespaceAnalyzer(TEST_VERSION_CURRENT);
>>>> -    IndexWriter writer = new IndexWriter(dir, appAnalyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT).setAnalyzer(appAnalyzer));
>>>>     int numDocs = 200;
>>>>     for (int i = 0; i < numDocs; i++) {
>>>>       Document doc = new Document();
>>>>
>>>> Modified: lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java (original)
>>>> +++ lucene/java/trunk/contrib/analyzers/common/src/test/org/apache/lucene/analysis/shingle/ShingleAnalyzerWrapperTest.java Wed Mar 10 17:53:46 2010
>>>> @@ -31,6 +31,7 @@ import org.apache.lucene.analysis.tokena
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>>  import org.apache.lucene.queryParser.QueryParser;
>>>>  import org.apache.lucene.search.BooleanClause;
>>>> @@ -59,7 +60,7 @@ public class ShingleAnalyzerWrapperTest
>>>>    */
>>>>   public IndexSearcher setUpSearcher(Analyzer analyzer) throws Exception {
>>>>     Directory dir = new RAMDirectory();
>>>> -    IndexWriter writer = new IndexWriter(dir, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT).setAnalyzer(analyzer));
>>>>
>>>>     Document doc;
>>>>     doc = new Document();
>>>>
>>>> Modified: lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java (original)
>>>> +++ lucene/java/trunk/contrib/ant/src/java/org/apache/lucene/ant/IndexTask.java Wed Mar 10 17:53:46 2010
>>>> @@ -38,7 +38,10 @@ import org.apache.lucene.document.DateTo
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>> +import org.apache.lucene.index.LogMergePolicy;
>>>>  import org.apache.lucene.index.Term;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.search.IndexSearcher;
>>>>  import org.apache.lucene.search.ScoreDoc;
>>>>  import org.apache.lucene.search.Searcher;
>>>> @@ -280,15 +283,17 @@ public class IndexTask extends Task {
>>>>
>>>>       log("checkLastModified = " + checkLastModified, Project.MSG_VERBOSE);
>>>>
>>>> -      IndexWriter writer =
>>>> -        new IndexWriter(dir, analyzer, create, IndexWriter.MaxFieldLength.LIMITED);
>>>> -
>>>> -      writer.setUseCompoundFile(useCompoundIndex);
>>>> +      IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
>>>> +          Version.LUCENE_CURRENT).setAnalyzer(analyzer).setOpenMode(
>>>> +          create ? OpenMode.CREATE : OpenMode.APPEND));
>>>> +      LogMergePolicy lmp = (LogMergePolicy) writer.getMergePolicy();
>>>> +      lmp.setUseCompoundFile(useCompoundIndex);
>>>> +      lmp.setUseCompoundDocStore(useCompoundIndex);
>>>> +      lmp.setMergeFactor(mergeFactor);
>>>>       int totalFiles = 0;
>>>>       int totalIndexed = 0;
>>>>       int totalIgnored = 0;
>>>>       try {
>>>> -        writer.setMergeFactor(mergeFactor);
>>>>
>>>>         for (int i = 0; i < rcs.size(); i++) {
>>>>           ResourceCollection rc = rcs.elementAt(i);
>>>>
>>>> Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java (original)
>>>> +++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/CreateIndexTask.java Wed Mar 10 17:53:46 2010
>>>> @@ -21,9 +21,12 @@ import org.apache.lucene.benchmark.byTas
>>>>  import org.apache.lucene.benchmark.byTask.utils.Config;
>>>>  import org.apache.lucene.index.IndexDeletionPolicy;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.MergeScheduler;
>>>>  import org.apache.lucene.index.ConcurrentMergeScheduler;
>>>>  import org.apache.lucene.index.MergePolicy;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>> +import org.apache.lucene.util.Version;
>>>>
>>>>  import java.io.BufferedOutputStream;
>>>>  import java.io.File;
>>>> @@ -99,7 +102,7 @@ public class CreateIndexTask extends Per
>>>>
>>>>     final double ramBuffer = config.get("ram.flush.mb",OpenIndexTask.DEFAULT_RAM_FLUSH_MB);
>>>>     final int maxBuffered = config.get("max.buffered",OpenIndexTask.DEFAULT_MAX_BUFFERED);
>>>> -    if (maxBuffered == IndexWriter.DISABLE_AUTO_FLUSH) {
>>>> +    if (maxBuffered == IndexWriterConfig.DISABLE_AUTO_FLUSH) {
>>>>       writer.setRAMBufferSizeMB(ramBuffer);
>>>>       writer.setMaxBufferedDocs(maxBuffered);
>>>>     } else {
>>>> @@ -147,10 +150,9 @@ public class CreateIndexTask extends Per
>>>>     Config config = runData.getConfig();
>>>>
>>>>     IndexWriter writer = new IndexWriter(runData.getDirectory(),
>>>> -                                         runData.getAnalyzer(),
>>>> -                                         true,
>>>> -                                         getIndexDeletionPolicy(config),
>>>> -                                         IndexWriter.MaxFieldLength.LIMITED);
>>>> +        new IndexWriterConfig(Version.LUCENE_31).setAnalyzer(
>>>> +            runData.getAnalyzer()).setOpenMode(OpenMode.CREATE)
>>>> +            .setIndexDeletionPolicy(getIndexDeletionPolicy(config)));
>>>>     setIndexWriterConfig(writer, config);
>>>>     runData.setIndexWriter(writer);
>>>>     return 1;
>>>>
>>>> Modified: lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java (original)
>>>> +++ lucene/java/trunk/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/OpenIndexTask.java Wed Mar 10 17:53:46 2010
>>>> @@ -21,7 +21,9 @@ import org.apache.lucene.benchmark.byTas
>>>>  import org.apache.lucene.benchmark.byTask.utils.Config;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>>  import org.apache.lucene.index.IndexCommit;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.LogMergePolicy;
>>>> +import org.apache.lucene.util.Version;
>>>>
>>>>  import java.io.IOException;
>>>>
>>>> @@ -39,10 +41,10 @@ import java.io.IOException;
>>>>  */
>>>>  public class OpenIndexTask extends PerfTask {
>>>>
>>>> -  public static final int DEFAULT_MAX_BUFFERED = IndexWriter.DEFAULT_MAX_BUFFERED_DOCS;
>>>> -  public static final int DEFAULT_MAX_FIELD_LENGTH = IndexWriter.DEFAULT_MAX_FIELD_LENGTH;
>>>> +  public static final int DEFAULT_MAX_BUFFERED = IndexWriterConfig.DEFAULT_MAX_BUFFERED_DOCS;
>>>> +  public static final int DEFAULT_MAX_FIELD_LENGTH = IndexWriterConfig.UNLIMITED_FIELD_LENGTH;
>>>>   public static final int DEFAULT_MERGE_PFACTOR = LogMergePolicy.DEFAULT_MERGE_FACTOR;
>>>> -  public static final double DEFAULT_RAM_FLUSH_MB = (int) IndexWriter.DEFAULT_RAM_BUFFER_SIZE_MB;
>>>> +  public static final double DEFAULT_RAM_FLUSH_MB = (int) IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB;
>>>>   private String commitUserData;
>>>>
>>>>   public OpenIndexTask(PerfRunData runData) {
>>>> @@ -61,10 +63,9 @@ public class OpenIndexTask extends PerfT
>>>>     }
>>>>
>>>>     IndexWriter writer = new IndexWriter(runData.getDirectory(),
>>>> -                                         runData.getAnalyzer(),
>>>> -                                         CreateIndexTask.getIndexDeletionPolicy(config),
>>>> -                                         IndexWriter.MaxFieldLength.UNLIMITED,
>>>> -                                         ic);
>>>> +        new IndexWriterConfig(Version.LUCENE_CURRENT).setAnalyzer(
>>>> +            runData.getAnalyzer()).setIndexDeletionPolicy(
>>>> +            CreateIndexTask.getIndexDeletionPolicy(config)).setIndexCommit(ic));
>>>>     CreateIndexTask.setIndexWriterConfig(writer, config);
>>>>     runData.setIndexWriter(writer);
>>>>     return 1;
>>>>
>>>> Modified: lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java (original)
>>>> +++ lucene/java/trunk/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java Wed Mar 10 17:53:46 2010
>>>> @@ -36,12 +36,15 @@ import org.apache.lucene.benchmark.byTas
>>>>  import org.apache.lucene.collation.CollationKeyAnalyzer;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>> +import org.apache.lucene.index.LogMergePolicy;
>>>>  import org.apache.lucene.index.Term;
>>>>  import org.apache.lucene.index.TermEnum;
>>>>  import org.apache.lucene.index.TermDocs;
>>>>  import org.apache.lucene.index.SerialMergeScheduler;
>>>>  import org.apache.lucene.index.LogDocMergePolicy;
>>>>  import org.apache.lucene.index.TermFreqVector;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.store.Directory;
>>>>  import org.apache.lucene.search.FieldCache.StringIndex;
>>>>  import org.apache.lucene.search.FieldCache;
>>>> @@ -96,7 +99,9 @@ public class TestPerfTasksLogic extends
>>>>     assertEquals("TestSearchTask was supposed to be called!",279,CountingSearchTestTask.numSearches);
>>>>     assertTrue("Index does not exist?...!", IndexReader.indexExists(benchmark.getRunData().getDirectory()));
>>>>     // now we should be able to open the index for write.
>>>> -    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(),null,false, IndexWriter.MaxFieldLength.LIMITED);
>>>> +    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(),
>>>> +        new IndexWriterConfig(TEST_VERSION_CURRENT)
>>>> +            .setOpenMode(OpenMode.APPEND));
>>>>     iw.close();
>>>>     IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory(), true);
>>>>     assertEquals("1000 docs were added to the index, this is what we expect to find!",1000,ir.numDocs());
>>>> @@ -182,7 +187,7 @@ public class TestPerfTasksLogic extends
>>>>
>>>>     assertTrue("Index does not exist?...!", IndexReader.indexExists(benchmark.getRunData().getDirectory()));
>>>>     // now we should be able to open the index for write.
>>>> -    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(),null,false, IndexWriter.MaxFieldLength.LIMITED);
>>>> +    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(), new IndexWriterConfig(TEST_VERSION_CURRENT).setOpenMode(OpenMode.APPEND));
>>>>     iw.close();
>>>>     IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory(), true);
>>>>     assertEquals("100 docs were added to the index, this is what we expect to find!",100,ir.numDocs());
>>>> @@ -221,7 +226,7 @@ public class TestPerfTasksLogic extends
>>>>
>>>>     assertTrue("Index does not exist?...!", IndexReader.indexExists(benchmark.getRunData().getDirectory()));
>>>>     // now we should be able to open the index for write.
>>>> -    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(),null,false,IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(), new IndexWriterConfig(TEST_VERSION_CURRENT).setOpenMode(OpenMode.APPEND));
>>>>     iw.close();
>>>>     IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory(), true);
>>>>     assertEquals("1000 docs were added to the index, this is what we expect to find!",1000,ir.numDocs());
>>>> @@ -294,7 +299,7 @@ public class TestPerfTasksLogic extends
>>>>     assertEquals("TestSearchTask was supposed to be called!",139,CountingSearchTestTask.numSearches);
>>>>     assertTrue("Index does not exist?...!", IndexReader.indexExists(benchmark.getRunData().getDirectory()));
>>>>     // now we should be able to open the index for write.
>>>> -    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(),null,false,IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(), new IndexWriterConfig(TEST_VERSION_CURRENT).setOpenMode(OpenMode.APPEND));
>>>>     iw.close();
>>>>     IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory(), true);
>>>>     assertEquals("1 docs were added to the index, this is what we expect to find!",1,ir.numDocs());
>>>> @@ -417,7 +422,9 @@ public class TestPerfTasksLogic extends
>>>>     benchmark = execBenchmark(algLines2);
>>>>
>>>>     // now we should be able to open the index for write.
>>>> -    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(),null,false,IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter iw = new IndexWriter(benchmark.getRunData().getDirectory(),
>>>> +        new IndexWriterConfig(TEST_VERSION_CURRENT)
>>>> +            .setOpenMode(OpenMode.APPEND));
>>>>     iw.close();
>>>>
>>>>     IndexReader ir = IndexReader.open(benchmark.getRunData().getDirectory(), true);
>>>> @@ -655,7 +662,9 @@ public class TestPerfTasksLogic extends
>>>>     // 2. execute the algorithm  (required in every "logic" test)
>>>>     Benchmark benchmark = execBenchmark(algLines);
>>>>
>>>> -    assertTrue("did not use the specified MergeScheduler", ((MyMergeScheduler) benchmark.getRunData().getIndexWriter().getMergeScheduler()).called);
>>>> +    assertTrue("did not use the specified MergeScheduler",
>>>> +        ((MyMergeScheduler) benchmark.getRunData().getIndexWriter().getConfig()
>>>> +            .getMergeScheduler()).called);
>>>>     benchmark.getRunData().getIndexWriter().close();
>>>>
>>>>     // 3. test number of docs in the index
>>>> @@ -743,10 +752,10 @@ public class TestPerfTasksLogic extends
>>>>     // 2. execute the algorithm  (required in every "logic" test)
>>>>     Benchmark benchmark = execBenchmark(algLines);
>>>>     final IndexWriter writer = benchmark.getRunData().getIndexWriter();
>>>> -    assertEquals(2, writer.getMaxBufferedDocs());
>>>> -    assertEquals(IndexWriter.DISABLE_AUTO_FLUSH, (int) writer.getRAMBufferSizeMB());
>>>> -    assertEquals(3, writer.getMergeFactor());
>>>> -    assertFalse(writer.getUseCompoundFile());
>>>> +    assertEquals(2, writer.getConfig().getMaxBufferedDocs());
>>>> +    assertEquals(IndexWriterConfig.DISABLE_AUTO_FLUSH, (int) writer.getConfig().getRAMBufferSizeMB());
>>>> +    assertEquals(3, ((LogMergePolicy) writer.getMergePolicy()).getMergeFactor());
>>>> +    assertFalse(((LogMergePolicy) writer.getMergePolicy()).getUseCompoundFile());
>>>>     writer.close();
>>>>     Directory dir = benchmark.getRunData().getDirectory();
>>>>     IndexReader reader = IndexReader.open(dir, true);
>>>>
>>>> Modified: lucene/java/trunk/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java (original)
>>>> +++ lucene/java/trunk/contrib/fast-vector-highlighter/src/java/org/apache/lucene/search/vectorhighlight/FieldTermStack.java Wed Mar 10 17:53:46 2010
>>>> @@ -30,10 +30,10 @@ import org.apache.lucene.document.Field.
>>>>  import org.apache.lucene.document.Field.TermVector;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.TermFreqVector;
>>>>  import org.apache.lucene.index.TermPositionVector;
>>>>  import org.apache.lucene.index.TermVectorOffsetInfo;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>>  import org.apache.lucene.queryParser.QueryParser;
>>>>  import org.apache.lucene.search.Query;
>>>>  import org.apache.lucene.store.Directory;
>>>> @@ -50,13 +50,13 @@ public class FieldTermStack {
>>>>   LinkedList<TermInfo> termList = new LinkedList<TermInfo>();
>>>>
>>>>   public static void main( String[] args ) throws Exception {
>>>> -    Analyzer analyzer = new WhitespaceAnalyzer();
>>>> +    Analyzer analyzer = new WhitespaceAnalyzer(Version.LUCENE_CURRENT);
>>>>     QueryParser parser = new QueryParser(Version.LUCENE_CURRENT,  "f", analyzer );
>>>>     Query query = parser.parse( "a x:b" );
>>>>     FieldQuery fieldQuery = new FieldQuery( query, true, false );
>>>>
>>>>     Directory dir = new RAMDirectory();
>>>> -    IndexWriter writer = new IndexWriter( dir, analyzer, MaxFieldLength.LIMITED );
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(Version.LUCENE_CURRENT).setAnalyzer(analyzer));
>>>>     Document doc = new Document();
>>>>     doc.add( new Field( "f", "a a a b b c a b b c d e f", Store.YES, Index.ANALYZED, TermVector.WITH_POSITIONS_OFFSETS ) );
>>>>     doc.add( new Field( "f", "b a b a f", Store.YES, Index.ANALYZED, TermVector.WITH_POSITIONS_OFFSETS ) );
>>>>
>>>> Modified: lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java (original)
>>>> +++ lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/AbstractTestCase.java Wed Mar 10 17:53:46 2010
>>>> @@ -35,8 +35,9 @@ import org.apache.lucene.document.Field.
>>>>  import org.apache.lucene.document.Field.TermVector;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.queryParser.QueryParser;
>>>>  import org.apache.lucene.search.DisjunctionMaxQuery;
>>>>  import org.apache.lucene.search.PhraseQuery;
>>>> @@ -326,7 +327,9 @@ public abstract class AbstractTestCase e
>>>>
>>>>   // make 1 doc with multi valued field
>>>>   protected void make1dmfIndex( Analyzer analyzer, String... values ) throws Exception {
>>>> -    IndexWriter writer = new IndexWriter( dir, analyzer, true, MaxFieldLength.LIMITED );
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setAnalyzer(analyzer)
>>>> +        .setOpenMode(OpenMode.CREATE));
>>>>     Document doc = new Document();
>>>>     for( String value: values )
>>>>       doc.add( new Field( F, value, Store.YES, Index.ANALYZED, TermVector.WITH_POSITIONS_OFFSETS ) );
>>>> @@ -338,7 +341,9 @@ public abstract class AbstractTestCase e
>>>>
>>>>   // make 1 doc with multi valued & not analyzed field
>>>>   protected void make1dmfIndexNA( String... values ) throws Exception {
>>>> -    IndexWriter writer = new IndexWriter( dir, analyzerK, true, MaxFieldLength.LIMITED );
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setOpenMode(OpenMode.CREATE).setAnalyzer(
>>>> +        analyzerK));
>>>>     Document doc = new Document();
>>>>     for( String value: values )
>>>>       doc.add( new Field( F, value, Store.YES, Index.NOT_ANALYZED, TermVector.WITH_POSITIONS_OFFSETS ) );
>>>>
>>>> Modified: lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java (original)
>>>> +++ lucene/java/trunk/contrib/fast-vector-highlighter/src/test/org/apache/lucene/search/vectorhighlight/SimpleFragmentsBuilderTest.java Wed Mar 10 17:53:46 2010
>>>> @@ -24,7 +24,8 @@ import org.apache.lucene.document.Field.
>>>>  import org.apache.lucene.document.Field.TermVector;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.search.Query;
>>>>
>>>>  public class SimpleFragmentsBuilderTest extends AbstractTestCase {
>>>> @@ -118,7 +119,9 @@ public class SimpleFragmentsBuilderTest
>>>>   }
>>>>
>>>>   protected void makeUnstoredIndex() throws Exception {
>>>> -    IndexWriter writer = new IndexWriter( dir, analyzerW, true, MaxFieldLength.LIMITED );
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setOpenMode(OpenMode.CREATE).setAnalyzer(
>>>> +        analyzerW));
>>>>     Document doc = new Document();
>>>>     doc.add( new Field( F, "aaa", Store.NO, Index.ANALYZED, TermVector.WITH_POSITIONS_OFFSETS ) );
>>>>     writer.addDocument( doc );
>>>>
>>>> Modified: lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java (original)
>>>> +++ lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterPhraseTest.java Wed Mar 10 17:53:46 2010
>>>> @@ -21,7 +21,6 @@ import java.io.IOException;
>>>>
>>>>  import org.apache.lucene.analysis.Token;
>>>>  import org.apache.lucene.analysis.TokenStream;
>>>> -import org.apache.lucene.analysis.WhitespaceAnalyzer;
>>>>  import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
>>>>  import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
>>>>  import org.apache.lucene.analysis.tokenattributes.TermAttribute;
>>>> @@ -33,9 +32,9 @@ import org.apache.lucene.document.Field.
>>>>  import org.apache.lucene.index.CorruptIndexException;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>>  import org.apache.lucene.index.TermPositionVector;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>>  import org.apache.lucene.search.Collector;
>>>>  import org.apache.lucene.search.IndexSearcher;
>>>>  import org.apache.lucene.search.PhraseQuery;
>>>> @@ -59,7 +58,7 @@ public class HighlighterPhraseTest exten
>>>>     final String TEXT = "the fox jumped";
>>>>     final Directory directory = new RAMDirectory();
>>>>     final IndexWriter indexWriter = new IndexWriter(directory,
>>>> -        new WhitespaceAnalyzer(TEST_VERSION_CURRENT), MaxFieldLength.UNLIMITED);
>>>> +        new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     try {
>>>>       final Document document = new Document();
>>>>       document.add(new Field(FIELD, new TokenStreamConcurrent(),
>>>> @@ -102,7 +101,7 @@ public class HighlighterPhraseTest exten
>>>>     final String TEXT = "the fox jumped";
>>>>     final Directory directory = new RAMDirectory();
>>>>     final IndexWriter indexWriter = new IndexWriter(directory,
>>>> -        new WhitespaceAnalyzer(TEST_VERSION_CURRENT), MaxFieldLength.UNLIMITED);
>>>> +        new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     try {
>>>>       final Document document = new Document();
>>>>       document.add(new Field(FIELD, new TokenStreamConcurrent(),
>>>> @@ -171,7 +170,7 @@ public class HighlighterPhraseTest exten
>>>>     final String TEXT = "the fox did not jump";
>>>>     final Directory directory = new RAMDirectory();
>>>>     final IndexWriter indexWriter = new IndexWriter(directory,
>>>> -        new WhitespaceAnalyzer(TEST_VERSION_CURRENT), MaxFieldLength.UNLIMITED);
>>>> +        new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     try {
>>>>       final Document document = new Document();
>>>>       document.add(new Field(FIELD, new TokenStreamSparse(),
>>>> @@ -213,7 +212,7 @@ public class HighlighterPhraseTest exten
>>>>     final String TEXT = "the fox did not jump";
>>>>     final Directory directory = new RAMDirectory();
>>>>     final IndexWriter indexWriter = new IndexWriter(directory,
>>>> -        new WhitespaceAnalyzer(TEST_VERSION_CURRENT), MaxFieldLength.UNLIMITED);
>>>> +        new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     try {
>>>>       final Document document = new Document();
>>>>       document.add(new Field(FIELD, TEXT, Store.YES, Index.ANALYZED,
>>>> @@ -253,7 +252,7 @@ public class HighlighterPhraseTest exten
>>>>     final String TEXT = "the fox did not jump";
>>>>     final Directory directory = new RAMDirectory();
>>>>     final IndexWriter indexWriter = new IndexWriter(directory,
>>>> -        new WhitespaceAnalyzer(TEST_VERSION_CURRENT), MaxFieldLength.UNLIMITED);
>>>> +        new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     try {
>>>>       final Document document = new Document();
>>>>       document.add(new Field(FIELD, new TokenStreamSparse(),
>>>>
>>>> Modified: lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java (original)
>>>> +++ lucene/java/trunk/contrib/highlighter/src/test/org/apache/lucene/search/highlight/HighlighterTest.java Wed Mar 10 17:53:46 2010
>>>> @@ -51,8 +51,9 @@ import org.apache.lucene.document.Field.
>>>>  import org.apache.lucene.document.Field.Store;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.queryParser.ParseException;
>>>>  import org.apache.lucene.queryParser.QueryParser;
>>>>  import org.apache.lucene.search.BooleanQuery;
>>>> @@ -80,7 +81,6 @@ import org.apache.lucene.search.spans.Sp
>>>>  import org.apache.lucene.store.Directory;
>>>>  import org.apache.lucene.store.RAMDirectory;
>>>>  import org.apache.lucene.util.LuceneTestCase;
>>>> -import org.apache.lucene.util.Version;
>>>>  import org.w3c.dom.Element;
>>>>  import org.w3c.dom.NodeList;
>>>>
>>>> @@ -89,8 +89,6 @@ import org.w3c.dom.NodeList;
>>>>  *
>>>>  */
>>>>  public class HighlighterTest extends BaseTokenStreamTestCase implements Formatter {
>>>> -  // TODO: change to CURRENT, does not work because posIncr:
>>>> -  static final Version TEST_VERSION = TEST_VERSION_CURRENT;
>>>>
>>>>   private IndexReader reader;
>>>>   static final String FIELD_NAME = "contents";
>>>> @@ -99,7 +97,7 @@ public class HighlighterTest extends Bas
>>>>   RAMDirectory ramDir;
>>>>   public IndexSearcher searcher = null;
>>>>   int numHighlights = 0;
>>>> -  final Analyzer analyzer = new StandardAnalyzer(TEST_VERSION);
>>>> +  final Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT);
>>>>   TopDocs hits;
>>>>
>>>>   String[] texts = {
>>>> @@ -120,7 +118,7 @@ public class HighlighterTest extends Bas
>>>>
>>>>   public void testQueryScorerHits() throws Exception {
>>>>     Analyzer analyzer = new SimpleAnalyzer(TEST_VERSION_CURRENT);
>>>> -    QueryParser qp = new QueryParser(TEST_VERSION, FIELD_NAME, analyzer);
>>>> +    QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, analyzer);
>>>>     query = qp.parse("\"very long\"");
>>>>     searcher = new IndexSearcher(ramDir, true);
>>>>     TopDocs hits = searcher.search(query, 10);
>>>> @@ -150,7 +148,7 @@ public class HighlighterTest extends Bas
>>>>
>>>>     String s1 = "I call our world Flatland, not because we call it so,";
>>>>
>>>> -    QueryParser parser = new QueryParser(TEST_VERSION, FIELD_NAME, new StandardAnalyzer(TEST_VERSION));
>>>> +    QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, new StandardAnalyzer(TEST_VERSION_CURRENT));
>>>>
>>>>     // Verify that a query against the default field results in text being
>>>>     // highlighted
>>>> @@ -182,7 +180,7 @@ public class HighlighterTest extends Bas
>>>>    */
>>>>   private static String highlightField(Query query, String fieldName, String text)
>>>>       throws IOException, InvalidTokenOffsetsException {
>>>> -    TokenStream tokenStream = new StandardAnalyzer(TEST_VERSION).tokenStream(fieldName, new StringReader(text));
>>>> +    TokenStream tokenStream = new StandardAnalyzer(TEST_VERSION_CURRENT).tokenStream(fieldName, new StringReader(text));
>>>>     // Assuming "<B>", "</B>" used to highlight
>>>>     SimpleHTMLFormatter formatter = new SimpleHTMLFormatter();
>>>>     QueryScorer scorer = new QueryScorer(query, fieldName, FIELD_NAME);
>>>> @@ -228,7 +226,7 @@ public class HighlighterTest extends Bas
>>>>     String q = "(" + f1c + ph1 + " OR " + f2c + ph1 + ") AND (" + f1c + ph2
>>>>         + " OR " + f2c + ph2 + ")";
>>>>     Analyzer analyzer = new WhitespaceAnalyzer(TEST_VERSION_CURRENT);
>>>> -    QueryParser qp = new QueryParser(TEST_VERSION, f1, analyzer);
>>>> +    QueryParser qp = new QueryParser(TEST_VERSION_CURRENT, f1, analyzer);
>>>>     Query query = qp.parse(q);
>>>>
>>>>     QueryScorer scorer = new QueryScorer(query, f1);
>>>> @@ -678,7 +676,7 @@ public class HighlighterTest extends Bas
>>>>         // Need to explicitly set the QueryParser property to use TermRangeQuery
>>>>         // rather
>>>>         // than RangeFilters
>>>> -        QueryParser parser = new QueryParser(TEST_VERSION, FIELD_NAME, analyzer);
>>>> +        QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, analyzer);
>>>>         parser.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
>>>>         query = parser.parse(queryString);
>>>>         doSearching(query);
>>>> @@ -1028,7 +1026,7 @@ public class HighlighterTest extends Bas
>>>>         String srchkey = "football";
>>>>
>>>>         String s = "football-soccer in the euro 2004 footie competition";
>>>> -        QueryParser parser = new QueryParser(TEST_VERSION, "bookid", analyzer);
>>>> +        QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, "bookid", analyzer);
>>>>         Query query = parser.parse(srchkey);
>>>>
>>>>         TokenStream tokenStream = analyzer.tokenStream(null, new StringReader(s));
>>>> @@ -1154,13 +1152,13 @@ public class HighlighterTest extends Bas
>>>>           sb.append(stopWords.iterator().next());
>>>>         }
>>>>         SimpleHTMLFormatter fm = new SimpleHTMLFormatter();
>>>> -        Highlighter hg = getHighlighter(query, "data", new StandardAnalyzer(TEST_VERSION, stopWords).tokenStream(
>>>> +        Highlighter hg = getHighlighter(query, "data", new StandardAnalyzer(TEST_VERSION_CURRENT, stopWords).tokenStream(
>>>>             "data", new StringReader(sb.toString())), fm);// new Highlighter(fm,
>>>>         // new
>>>>         // QueryTermScorer(query));
>>>>         hg.setTextFragmenter(new NullFragmenter());
>>>>         hg.setMaxDocCharsToAnalyze(100);
>>>> -        match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION, stopWords), "data", sb.toString());
>>>> +        match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION_CURRENT, stopWords), "data", sb.toString());
>>>>         assertTrue("Matched text should be no more than 100 chars in length ", match.length() < hg
>>>>             .getMaxDocCharsToAnalyze());
>>>>
>>>> @@ -1171,7 +1169,7 @@ public class HighlighterTest extends Bas
>>>>         // + whitespace)
>>>>         sb.append(" ");
>>>>         sb.append(goodWord);
>>>> -        match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION, stopWords), "data", sb.toString());
>>>> +        match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION_CURRENT, stopWords), "data", sb.toString());
>>>>         assertTrue("Matched text should be no more than 100 chars in length ", match.length() < hg
>>>>             .getMaxDocCharsToAnalyze());
>>>>       }
>>>> @@ -1192,11 +1190,11 @@ public class HighlighterTest extends Bas
>>>>
>>>>         String text = "this is a text with searchterm in it";
>>>>         SimpleHTMLFormatter fm = new SimpleHTMLFormatter();
>>>> -        Highlighter hg = getHighlighter(query, "text", new StandardAnalyzer(TEST_VERSION,
>>>> +        Highlighter hg = getHighlighter(query, "text", new StandardAnalyzer(TEST_VERSION_CURRENT,
>>>>             stopWords).tokenStream("text", new StringReader(text)), fm);
>>>>         hg.setTextFragmenter(new NullFragmenter());
>>>>         hg.setMaxDocCharsToAnalyze(36);
>>>> -        String match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION, stopWords), "text", text);
>>>> +        String match = hg.getBestFragment(new StandardAnalyzer(TEST_VERSION_CURRENT, stopWords), "text", text);
>>>>         assertTrue(
>>>>             "Matched text should contain remainder of text after highlighted query ",
>>>>             match.endsWith("in it"));
>>>> @@ -1213,9 +1211,9 @@ public class HighlighterTest extends Bas
>>>>         numHighlights = 0;
>>>>         // test to show how rewritten query can still be used
>>>>         searcher = new IndexSearcher(ramDir, true);
>>>> -        Analyzer analyzer = new StandardAnalyzer(TEST_VERSION);
>>>> +        Analyzer analyzer = new StandardAnalyzer(TEST_VERSION_CURRENT);
>>>>
>>>> -        QueryParser parser = new QueryParser(TEST_VERSION, FIELD_NAME, analyzer);
>>>> +        QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, analyzer);
>>>>         Query query = parser.parse("JF? or Kenned*");
>>>>         System.out.println("Searching with primitive query");
>>>>         // forget to set this and...
>>>> @@ -1326,7 +1324,9 @@ public class HighlighterTest extends Bas
>>>>   public void testMultiSearcher() throws Exception {
>>>>     // setup index 1
>>>>     RAMDirectory ramDir1 = new RAMDirectory();
>>>> -    IndexWriter writer1 = new IndexWriter(ramDir1, new StandardAnalyzer(TEST_VERSION), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter writer1 = new IndexWriter(ramDir1, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setAnalyzer(new StandardAnalyzer(
>>>> +        TEST_VERSION_CURRENT)));
>>>>     Document d = new Document();
>>>>     Field f = new Field(FIELD_NAME, "multiOne", Field.Store.YES, Field.Index.ANALYZED);
>>>>     d.add(f);
>>>> @@ -1337,7 +1337,9 @@ public class HighlighterTest extends Bas
>>>>
>>>>     // setup index 2
>>>>     RAMDirectory ramDir2 = new RAMDirectory();
>>>> -    IndexWriter writer2 = new IndexWriter(ramDir2, new StandardAnalyzer(TEST_VERSION), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter writer2 = new IndexWriter(ramDir2, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setAnalyzer(new StandardAnalyzer(
>>>> +        TEST_VERSION_CURRENT)));
>>>>     d = new Document();
>>>>     f = new Field(FIELD_NAME, "multiTwo", Field.Store.YES, Field.Index.ANALYZED);
>>>>     d.add(f);
>>>> @@ -1350,7 +1352,7 @@ public class HighlighterTest extends Bas
>>>>     searchers[0] = new IndexSearcher(ramDir1, true);
>>>>     searchers[1] = new IndexSearcher(ramDir2, true);
>>>>     MultiSearcher multiSearcher = new MultiSearcher(searchers);
>>>> -    QueryParser parser = new QueryParser(TEST_VERSION, FIELD_NAME, new StandardAnalyzer(TEST_VERSION));
>>>> +    QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, new StandardAnalyzer(TEST_VERSION_CURRENT));
>>>>     parser.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
>>>>     query = parser.parse("multi*");
>>>>     System.out.println("Searching for: " + query.toString(FIELD_NAME));
>>>> @@ -1384,7 +1386,7 @@ public class HighlighterTest extends Bas
>>>>       @Override
>>>>       public void run() throws Exception {
>>>>         String docMainText = "fred is one of the people";
>>>> -        QueryParser parser = new QueryParser(TEST_VERSION, FIELD_NAME, analyzer);
>>>> +        QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, analyzer);
>>>>         Query query = parser.parse("fred category:people");
>>>>
>>>>         // highlighting respects fieldnames used in query
>>>> @@ -1530,64 +1532,64 @@ public class HighlighterTest extends Bas
>>>>         Highlighter highlighter;
>>>>         String result;
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("foo");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("foo");
>>>>         highlighter = getHighlighter(query, "text", getTS2(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2(), s, 3, "...");
>>>>         assertEquals("Hi-Speed10 <B>foo</B>", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("10");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("10");
>>>>         highlighter = getHighlighter(query, "text", getTS2(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2(), s, 3, "...");
>>>>         assertEquals("Hi-Speed<B>10</B> foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi");
>>>>         highlighter = getHighlighter(query, "text", getTS2(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2(), s, 3, "...");
>>>>         assertEquals("<B>Hi</B>-Speed10 foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("speed");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("speed");
>>>>         highlighter = getHighlighter(query, "text", getTS2(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2(), s, 3, "...");
>>>>         assertEquals("Hi-<B>Speed</B>10 foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hispeed");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hispeed");
>>>>         highlighter = getHighlighter(query, "text", getTS2(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2(), s, 3, "...");
>>>>         assertEquals("<B>Hi-Speed</B>10 foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi speed");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi speed");
>>>>         highlighter = getHighlighter(query, "text", getTS2(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2(), s, 3, "...");
>>>>         assertEquals("<B>Hi-Speed</B>10 foo", result);
>>>>
>>>>         // ///////////////// same tests, just put the bigger overlapping token
>>>>         // first
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("foo");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("foo");
>>>>         highlighter = getHighlighter(query, "text", getTS2a(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2a(), s, 3, "...");
>>>>         assertEquals("Hi-Speed10 <B>foo</B>", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("10");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("10");
>>>>         highlighter = getHighlighter(query, "text", getTS2a(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2a(), s, 3, "...");
>>>>         assertEquals("Hi-Speed<B>10</B> foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi");
>>>>         highlighter = getHighlighter(query, "text", getTS2a(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2a(), s, 3, "...");
>>>>         assertEquals("<B>Hi</B>-Speed10 foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("speed");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("speed");
>>>>         highlighter = getHighlighter(query, "text", getTS2a(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2a(), s, 3, "...");
>>>>         assertEquals("Hi-<B>Speed</B>10 foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hispeed");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hispeed");
>>>>         highlighter = getHighlighter(query, "text", getTS2a(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2a(), s, 3, "...");
>>>>         assertEquals("<B>Hi-Speed</B>10 foo", result);
>>>>
>>>> -        query = new QueryParser(TEST_VERSION, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi speed");
>>>> +        query = new QueryParser(TEST_VERSION_CURRENT, "text", new WhitespaceAnalyzer(TEST_VERSION_CURRENT)).parse("hi speed");
>>>>         highlighter = getHighlighter(query, "text", getTS2a(), HighlighterTest.this);
>>>>         result = highlighter.getBestFragments(getTS2a(), s, 3, "...");
>>>>         assertEquals("<B>Hi-Speed</B>10 foo", result);
>>>> @@ -1613,7 +1615,7 @@ public class HighlighterTest extends Bas
>>>>   }
>>>>
>>>>   private void makeIndex() throws IOException {
>>>> -    IndexWriter writer = new IndexWriter( dir, a, MaxFieldLength.LIMITED );
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     writer.addDocument( doc( "t_text1", "random words for highlighting tests del" ) );
>>>>     writer.addDocument( doc( "t_text1", "more random words for second field del" ) );
>>>>     writer.addDocument( doc( "t_text1", "random words for highlighting tests del" ) );
>>>> @@ -1623,7 +1625,7 @@ public class HighlighterTest extends Bas
>>>>   }
>>>>
>>>>   private void deleteDocument() throws IOException {
>>>> -    IndexWriter writer = new IndexWriter( dir, a, false, MaxFieldLength.LIMITED );
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT).setOpenMode(OpenMode.APPEND));
>>>>     writer.deleteDocuments( new Term( "t_text1", "del" ) );
>>>>     // To see negative idf, keep comment the following line
>>>>     //writer.optimize();
>>>> @@ -1632,7 +1634,7 @@ public class HighlighterTest extends Bas
>>>>
>>>>   private void searchIndex() throws IOException, ParseException, InvalidTokenOffsetsException {
>>>>     String q = "t_text1:random";
>>>> -    QueryParser parser = new QueryParser(TEST_VERSION,  "t_text1", a );
>>>> +    QueryParser parser = new QueryParser(TEST_VERSION_CURRENT,  "t_text1", a );
>>>>     Query query = parser.parse( q );
>>>>     IndexSearcher searcher = new IndexSearcher( dir, true );
>>>>     // This scorer can return negative idf -> null fragment
>>>> @@ -1686,7 +1688,7 @@ public class HighlighterTest extends Bas
>>>>   }
>>>>
>>>>   public void doSearching(String queryString) throws Exception {
>>>> -    QueryParser parser = new QueryParser(TEST_VERSION, FIELD_NAME, analyzer);
>>>> +    QueryParser parser = new QueryParser(TEST_VERSION_CURRENT, FIELD_NAME, analyzer);
>>>>     parser.setEnablePositionIncrements(true);
>>>>     parser.setMultiTermRewriteMethod(MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE);
>>>>     query = parser.parse(queryString);
>>>> @@ -1725,7 +1727,9 @@ public class HighlighterTest extends Bas
>>>>   protected void setUp() throws Exception {
>>>>     super.setUp();
>>>>     ramDir = new RAMDirectory();
>>>> -    IndexWriter writer = new IndexWriter(ramDir, new StandardAnalyzer(TEST_VERSION), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter writer = new IndexWriter(ramDir, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setAnalyzer(new StandardAnalyzer(
>>>> +        TEST_VERSION_CURRENT)));
>>>>     for (int i = 0; i < texts.length; i++) {
>>>>       addDoc(writer, texts[i]);
>>>>     }
>>>>
>>>> Modified: lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestEmptyIndex.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestEmptyIndex.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestEmptyIndex.java (original)
>>>> +++ lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestEmptyIndex.java Wed Mar 10 17:53:46 2010
>>>> @@ -16,9 +16,12 @@
>>>>
>>>>  package org.apache.lucene.store.instantiated;
>>>>
>>>> -import junit.framework.TestCase;
>>>> +import java.io.IOException;
>>>> +import java.util.Arrays;
>>>> +
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>>  import org.apache.lucene.index.TermEnum;
>>>>  import org.apache.lucene.search.IndexSearcher;
>>>> @@ -26,11 +29,9 @@ import org.apache.lucene.search.TermQuer
>>>>  import org.apache.lucene.search.TopDocs;
>>>>  import org.apache.lucene.store.Directory;
>>>>  import org.apache.lucene.store.RAMDirectory;
>>>> +import org.apache.lucene.util.LuceneTestCase;
>>>>
>>>> -import java.util.Arrays;
>>>> -import java.io.IOException;
>>>> -
>>>> -public class TestEmptyIndex extends TestCase {
>>>> +public class TestEmptyIndex extends LuceneTestCase {
>>>>
>>>>   public void testSearch() throws Exception {
>>>>
>>>> @@ -60,7 +61,7 @@ public class TestEmptyIndex extends Test
>>>>     // make sure a Directory acts the same
>>>>
>>>>     Directory d = new RAMDirectory();
>>>> -    new IndexWriter(d, null, true, IndexWriter.MaxFieldLength.UNLIMITED).close();
>>>> +    new IndexWriter(d, new IndexWriterConfig(TEST_VERSION_CURRENT)).close();
>>>>     r = IndexReader.open(d, false);
>>>>     testNorms(r);
>>>>     r.close();
>>>> @@ -93,7 +94,7 @@ public class TestEmptyIndex extends Test
>>>>     // make sure a Directory acts the same
>>>>
>>>>     Directory d = new RAMDirectory();
>>>> -    new IndexWriter(d, null, true, IndexWriter.MaxFieldLength.UNLIMITED).close();
>>>> +    new IndexWriter(d, new IndexWriterConfig(TEST_VERSION_CURRENT)).close();
>>>>     r = IndexReader.open(d, false);
>>>>     termEnumTest(r);
>>>>     r.close();
>>>>
>>>> Modified: lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java (original)
>>>> +++ lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestIndicesEquals.java Wed Mar 10 17:53:46 2010
>>>> @@ -30,6 +30,7 @@ import org.apache.lucene.document.Docume
>>>>  import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Payload;
>>>>  import org.apache.lucene.index.Term;
>>>>  import org.apache.lucene.index.TermDocs;
>>>> @@ -60,7 +61,9 @@ public class TestIndicesEquals extends L
>>>>     RAMDirectory dir = new RAMDirectory();
>>>>
>>>>     // create dir data
>>>> -    IndexWriter indexWriter = new IndexWriter(dir, new StandardAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setAnalyzer(new StandardAnalyzer(
>>>> +        TEST_VERSION_CURRENT)));
>>>>     for (int i = 0; i < 20; i++) {
>>>>       Document document = new Document();
>>>>       assembleDocument(document, i);
>>>> @@ -84,7 +87,9 @@ public class TestIndicesEquals extends L
>>>>     InstantiatedIndex ii = new InstantiatedIndex();
>>>>
>>>>     // create dir data
>>>> -    IndexWriter indexWriter = new IndexWriter(dir, new StandardAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter indexWriter = new IndexWriter(dir, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setAnalyzer(new StandardAnalyzer(
>>>> +        TEST_VERSION_CURRENT)));
>>>>     for (int i = 0; i < 500; i++) {
>>>>       Document document = new Document();
>>>>       assembleDocument(document, i);
>>>>
>>>> Modified: lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestSerialization.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestSerialization.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestSerialization.java (original)
>>>> +++ lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestSerialization.java Wed Mar 10 17:53:46 2010
>>>> @@ -22,7 +22,7 @@ import org.apache.lucene.store.Directory
>>>>  import org.apache.lucene.util.LuceneTestCase;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>>  import org.apache.lucene.index.IndexReader;
>>>> -import org.apache.lucene.analysis.WhitespaceAnalyzer;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>>
>>>> @@ -35,7 +35,7 @@ public class TestSerialization extends L
>>>>
>>>>     Directory dir = new RAMDirectory();
>>>>
>>>> -    IndexWriter iw = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     Document doc = new Document();
>>>>     doc.add(new Field("foo", "bar rab abr bra rba", Field.Store.NO, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
>>>>     doc.add(new Field("moo", "bar rab abr bra rba", Field.Store.YES, Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS));
>>>>
>>>> Modified: lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java (original)
>>>> +++ lucene/java/trunk/contrib/instantiated/src/test/org/apache/lucene/store/instantiated/TestUnoptimizedReaderOnConstructor.java Wed Mar 10 17:53:46 2010
>>>> @@ -18,10 +18,11 @@ package org.apache.lucene.store.instanti
>>>>  import java.io.IOException;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.store.RAMDirectory;
>>>>  import org.apache.lucene.store.Directory;
>>>>  import org.apache.lucene.util.LuceneTestCase;
>>>> -import org.apache.lucene.analysis.WhitespaceAnalyzer;
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>>
>>>> @@ -32,17 +33,17 @@ public class TestUnoptimizedReaderOnCons
>>>>
>>>>   public void test() throws Exception {
>>>>     Directory dir = new RAMDirectory();
>>>> -    IndexWriter iw = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     addDocument(iw, "Hello, world!");
>>>>     addDocument(iw, "All work and no play makes jack a dull boy");
>>>>     iw.close();
>>>>
>>>> -    iw = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    iw = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT).setOpenMode(OpenMode.APPEND));
>>>>     addDocument(iw, "Hello, tellus!");
>>>>     addDocument(iw, "All work and no play makes danny a dull boy");
>>>>     iw.close();
>>>>
>>>> -    iw = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), false, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    iw = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT).setOpenMode(OpenMode.APPEND));
>>>>     addDocument(iw, "Hello, earth!");
>>>>     addDocument(iw, "All work and no play makes wendy a dull girl");
>>>>     iw.close();
>>>>
>>>> Modified: lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java (original)
>>>> +++ lucene/java/trunk/contrib/lucli/src/java/lucli/LuceneMethods.java Wed Mar 10 17:53:46 2010
>>>> @@ -42,9 +42,11 @@ import org.apache.lucene.document.Docume
>>>>  import org.apache.lucene.document.Fieldable;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>>  import org.apache.lucene.index.TermEnum;
>>>>  import org.apache.lucene.index.IndexReader.FieldOption;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.queryParser.MultiFieldQueryParser;
>>>>  import org.apache.lucene.queryParser.ParseException;
>>>>  import org.apache.lucene.search.Collector;
>>>> @@ -169,7 +171,9 @@ class LuceneMethods {
>>>>
>>>>     public void optimize() throws IOException {
>>>>     //open the index writer. False: don't create a new one
>>>> -    IndexWriter indexWriter = new IndexWriter(indexName, createAnalyzer(), false, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter indexWriter = new IndexWriter(indexName, new IndexWriterConfig(
>>>> +        Version.LUCENE_CURRENT).setAnalyzer(createAnalyzer()).setOpenMode(
>>>> +        OpenMode.APPEND));
>>>>     message("Starting to optimize index.");
>>>>     long start = System.currentTimeMillis();
>>>>     indexWriter.optimize();
>>>>
>>>> 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=921480&r1=921479&r2=921480&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 Wed Mar 10 17:53:46 2010
>>>> @@ -42,6 +42,7 @@ import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.document.Fieldable;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>>  import org.apache.lucene.index.IndexReader;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.queryParser.ParseException;
>>>>  import org.apache.lucene.queryParser.QueryParser;
>>>>  import org.apache.lucene.search.Collector;
>>>> @@ -410,7 +411,7 @@ public class MemoryIndexTest extends Bas
>>>>     RAMDirectory dir = new RAMDirectory();
>>>>     IndexWriter writer = null;
>>>>     try {
>>>> -      writer = new IndexWriter(dir, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +      writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT).setAnalyzer(analyzer));
>>>>       writer.addDocument(doc);
>>>>       writer.optimize();
>>>>       return dir;
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/index/MultiPassIndexSplitter.java Wed Mar 10 17:53:46 2010
>>>> @@ -21,11 +21,11 @@ import java.io.File;
>>>>  import java.io.IOException;
>>>>  import java.util.ArrayList;
>>>>
>>>> -import org.apache.lucene.analysis.WhitespaceAnalyzer;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.store.Directory;
>>>>  import org.apache.lucene.store.FSDirectory;
>>>>  import org.apache.lucene.util.OpenBitSet;
>>>> +import org.apache.lucene.util.Version;
>>>>
>>>>  /**
>>>>  * This tool splits input index into multiple equal parts. The method employed
>>>> @@ -88,8 +88,7 @@ public class MultiPassIndexSplitter {
>>>>           }
>>>>         }
>>>>       }
>>>> -      IndexWriter w = new IndexWriter(outputs[i], new WhitespaceAnalyzer(),
>>>> -              true, MaxFieldLength.UNLIMITED);
>>>> +      IndexWriter w = new IndexWriter(outputs[i], new IndexWriterConfig(Version.LUCENE_CURRENT).setOpenMode(OpenMode.CREATE));
>>>>       System.err.println("Writing part " + (i + 1) + " ...");
>>>>       w.addIndexes(new IndexReader[]{input});
>>>>       w.close();
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/IndexMergeTool.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/IndexMergeTool.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/IndexMergeTool.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/java/org/apache/lucene/misc/IndexMergeTool.java Wed Mar 10 17:53:46 2010
>>>> @@ -17,9 +17,11 @@ package org.apache.lucene.misc;
>>>>   */
>>>>
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> -import org.apache.lucene.analysis.SimpleAnalyzer;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.store.Directory;
>>>>  import org.apache.lucene.store.FSDirectory;
>>>> +import org.apache.lucene.util.Version;
>>>>
>>>>  import java.io.File;
>>>>  import java.io.IOException;
>>>> @@ -36,7 +38,8 @@ public class IndexMergeTool {
>>>>     }
>>>>     FSDirectory mergedIndex = FSDirectory.open(new File(args[0]));
>>>>
>>>> -    IndexWriter writer = new IndexWriter(mergedIndex, new  SimpleAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
>>>> +    IndexWriter writer = new IndexWriter(mergedIndex, new IndexWriterConfig(
>>>> +        Version.LUCENE_CURRENT).setOpenMode(OpenMode.CREATE));
>>>>
>>>>     Directory[] indexes = new Directory[args.length - 1];
>>>>     for (int i = 1; i < args.length; i++) {
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestFieldNormModifier.java Wed Mar 10 17:53:46 2010
>>>> @@ -23,7 +23,6 @@ import java.util.Arrays;
>>>>  import org.apache.lucene.analysis.SimpleAnalyzer;
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>>  import org.apache.lucene.search.Collector;
>>>>  import org.apache.lucene.search.DefaultSimilarity;
>>>>  import org.apache.lucene.search.IndexSearcher;
>>>> @@ -58,7 +57,9 @@ public class TestFieldNormModifier exten
>>>>   @Override
>>>>   protected void setUp() throws Exception {
>>>>     super.setUp();
>>>> -    IndexWriter writer = new IndexWriter(store, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter writer = new IndexWriter(store, new IndexWriterConfig(
>>>> +        TEST_VERSION_CURRENT).setAnalyzer(new SimpleAnalyzer(
>>>> +        TEST_VERSION_CURRENT)));
>>>>
>>>>     for (int i = 0; i < NUM_DOCS; i++) {
>>>>       Document d = new Document();
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestIndexSplitter.java Wed Mar 10 17:53:46 2010
>>>> @@ -18,9 +18,8 @@ package org.apache.lucene.index;
>>>>
>>>>  import java.io.File;
>>>>
>>>> -import org.apache.lucene.analysis.WhitespaceAnalyzer;
>>>>  import org.apache.lucene.document.Document;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>> +import org.apache.lucene.index.IndexWriterConfig.OpenMode;
>>>>  import org.apache.lucene.store.FSDirectory;
>>>>  import org.apache.lucene.util.LuceneTestCase;
>>>>  import org.apache.lucene.util._TestUtil;
>>>> @@ -35,7 +34,7 @@ public class TestIndexSplitter extends L
>>>>     _TestUtil.rmDir(destDir);
>>>>     destDir.mkdirs();
>>>>     FSDirectory fsDir = FSDirectory.open(dir);
>>>> -    IndexWriter iw = new IndexWriter(fsDir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter iw = new IndexWriter(fsDir, new IndexWriterConfig(TEST_VERSION_CURRENT).setOpenMode(OpenMode.CREATE));
>>>>     for (int x=0; x < 100; x++) {
>>>>       Document doc = TestIndexWriterReader.createDocument(x, "index", 5);
>>>>       iw.addDocument(doc);
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestMultiPassIndexSplitter.java Wed Mar 10 17:53:46 2010
>>>> @@ -16,10 +16,8 @@ package org.apache.lucene.index;
>>>>  * limitations under the License.
>>>>  */
>>>>
>>>> -import org.apache.lucene.analysis.WhitespaceAnalyzer;
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>>  import org.apache.lucene.store.Directory;
>>>>  import org.apache.lucene.store.RAMDirectory;
>>>>  import org.apache.lucene.util.LuceneTestCase;
>>>> @@ -32,8 +30,7 @@ public class TestMultiPassIndexSplitter
>>>>   protected void setUp() throws Exception {
>>>>     super.setUp();
>>>>     RAMDirectory dir = new RAMDirectory();
>>>> -    IndexWriter w = new IndexWriter(dir, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true,
>>>> -            MaxFieldLength.LIMITED);
>>>> +    IndexWriter w = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     Document doc;
>>>>     for (int i = 0; i < NUM_DOCS; i++) {
>>>>       doc = new Document();
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestTermVectorAccessor.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestTermVectorAccessor.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestTermVectorAccessor.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/index/TestTermVectorAccessor.java Wed Mar 10 17:53:46 2010
>>>> @@ -28,7 +28,7 @@ public class TestTermVectorAccessor exte
>>>>   public void test() throws Exception {
>>>>
>>>>     Directory dir = new RAMDirectory();
>>>> -    IndexWriter iw = new IndexWriter(dir, new StandardAnalyzer(TEST_VERSION_CURRENT, Collections.emptySet()), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT).setAnalyzer(new StandardAnalyzer(TEST_VERSION_CURRENT, Collections.emptySet())));
>>>>
>>>>     Document doc;
>>>>
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/ChainedFilterTest.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/ChainedFilterTest.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/ChainedFilterTest.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/ChainedFilterTest.java Wed Mar 10 17:53:46 2010
>>>> @@ -20,13 +20,11 @@ package org.apache.lucene.misc;
>>>>  import java.util.Calendar;
>>>>  import java.util.GregorianCalendar;
>>>>
>>>> -import org.apache.lucene.analysis.Analyzer;
>>>> -import org.apache.lucene.analysis.WhitespaceAnalyzer;
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>>  import org.apache.lucene.search.BooleanClause;
>>>>  import org.apache.lucene.search.BooleanQuery;
>>>>  import org.apache.lucene.search.CachingWrapperFilter;
>>>> @@ -58,8 +56,7 @@ public class ChainedFilterTest extends L
>>>>   protected void setUp() throws Exception {
>>>>     super.setUp();
>>>>     directory = new RAMDirectory();
>>>> -    IndexWriter writer =
>>>> -       new IndexWriter(directory, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), true, IndexWriter.MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>
>>>>     Calendar cal = new GregorianCalendar();
>>>>     cal.clear();
>>>> @@ -187,9 +184,7 @@ public class ChainedFilterTest extends L
>>>>
>>>>   public void testWithCachingFilter() throws Exception {
>>>>     Directory dir = new RAMDirectory();
>>>> -    Analyzer analyzer = new WhitespaceAnalyzer(TEST_VERSION_CURRENT);
>>>> -
>>>> -    IndexWriter writer = new IndexWriter(dir, analyzer, true, MaxFieldLength.LIMITED);
>>>> +    IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>     writer.close();
>>>>
>>>>     Searcher searcher = new IndexSearcher(dir, true);
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/misc/TestLengthNormModifier.java Wed Mar 10 17:53:46 2010
>>>> @@ -19,14 +19,13 @@ package org.apache.lucene.misc;
>>>>
>>>>  import java.io.IOException;
>>>>
>>>> -import org.apache.lucene.analysis.SimpleAnalyzer;
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.index.FieldNormModifier;
>>>>  import org.apache.lucene.index.IndexReader;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.index.Term;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>>  import org.apache.lucene.search.Collector;
>>>>  import org.apache.lucene.search.DefaultSimilarity;
>>>>  import org.apache.lucene.search.IndexSearcher;
>>>> @@ -61,7 +60,7 @@ public class TestLengthNormModifier exte
>>>>     @Override
>>>>     protected void setUp() throws Exception {
>>>>       super.setUp();
>>>> -       IndexWriter writer = new IndexWriter(store, new SimpleAnalyzer(TEST_VERSION_CURRENT), true, MaxFieldLength.UNLIMITED);
>>>> +       IndexWriter writer = new IndexWriter(store, new IndexWriterConfig(TEST_VERSION_CURRENT));
>>>>
>>>>        for (int i = 0; i < NUM_DOCS; i++) {
>>>>            Document d = new Document();
>>>>
>>>> Modified: lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java
>>>> URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java?rev=921480&r1=921479&r2=921480&view=diff
>>>> ==============================================================================
>>>> --- lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java (original)
>>>> +++ lucene/java/trunk/contrib/misc/src/test/org/apache/lucene/queryParser/complexPhrase/TestComplexPhraseQuery.java Wed Mar 10 17:53:46 2010
>>>> @@ -24,7 +24,7 @@ import org.apache.lucene.analysis.standa
>>>>  import org.apache.lucene.document.Document;
>>>>  import org.apache.lucene.document.Field;
>>>>  import org.apache.lucene.index.IndexWriter;
>>>> -import org.apache.lucene.index.IndexWriter.MaxFieldLength;
>>>> +import org.apache.lucene.index.IndexWriterConfig;
>>>>  import org.apache.lucene.queryParser.QueryParser;
>>>>  import org.apache.lucene.search.IndexSearcher;
>>>>  import org.apache.lucene.search.Query;
>>>> @@ -113,7 +113,7 @@ public class TestComplexPhraseQuery exte
>>>>   protected void setUp() throws Exception {
>>>>     super.setUp();
>>>>     RAMDirectory rd = new RAMDirectory();
>>>> -    IndexWriter w = new IndexWriter(rd, analyzer, MaxFieldLength.UNLIMITED);
>>>> +    IndexWriter w = new IndexWriter(rd, new IndexWriterConfig(TEST_VERSION_CURRENT).setAnalyzer(analyzer));
>>>>     for (int i = 0; i < docsContent.length; i++) {
>>>>       Document doc = new Document();
>>>>       doc.add(new Field("name", docsContent[i].name, Field.Store.YES,
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Robert Muir
>>> rcmuir@gmail.com
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-dev-help@lucene.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-dev-help@lucene.apache.org
>>
>>
>
>
>
> --
> Robert Muir
> rcmuir@gmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message