diff --git a/lucene/facet/build.xml b/lucene/facet/build.xml index 7536e6c4825..81a4c804752 100644 --- a/lucene/facet/build.xml +++ b/lucene/facet/build.xml @@ -39,8 +39,6 @@ - - diff --git a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java index 9bd3d9155f1..c74a3d4d0c3 100644 --- a/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java +++ b/lucene/facet/src/java/org/apache/lucene/facet/taxonomy/directory/DirectoryTaxonomyWriter.java @@ -14,7 +14,6 @@ import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import org.apache.lucene.analysis.TokenStream; -import org.apache.lucene.analysis.core.KeywordAnalyzer; import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute; import org.apache.lucene.document.Document; @@ -30,7 +29,7 @@ import org.apache.lucene.facet.taxonomy.writercache.cl2o.Cl2oTaxonomyWriterCache import org.apache.lucene.facet.taxonomy.writercache.lru.LruTaxonomyWriterCache; import org.apache.lucene.index.AtomicReader; import org.apache.lucene.index.AtomicReaderContext; -import org.apache.lucene.index.CorruptIndexException; // javadocs +import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.DirectoryReader; import org.apache.lucene.index.DocsEnum; import org.apache.lucene.index.IndexReader; @@ -45,7 +44,7 @@ import org.apache.lucene.index.TermsEnum; import org.apache.lucene.index.TieredMergePolicy; import org.apache.lucene.store.AlreadyClosedException; import org.apache.lucene.store.Directory; -import org.apache.lucene.store.LockObtainFailedException; // javadocs +import org.apache.lucene.store.LockObtainFailedException; import org.apache.lucene.store.NativeFSLockFactory; import org.apache.lucene.store.SimpleFSLockFactory; import org.apache.lucene.util.BytesRef; @@ -303,8 +302,7 @@ public class DirectoryTaxonomyWriter implements TaxonomyWriter { // Make sure we use a MergePolicy which always merges adjacent segments and thus // keeps the doc IDs ordered as well (this is crucial for the taxonomy index). - return new IndexWriterConfig(Version.LUCENE_50, - new KeywordAnalyzer()).setOpenMode(openMode).setMergePolicy( + return new IndexWriterConfig(Version.LUCENE_50, null).setOpenMode(openMode).setMergePolicy( new LogByteSizeMergePolicy()); } diff --git a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java index ac438085fe9..3d69848948c 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/FacetTestUtils.java @@ -4,7 +4,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.facet.index.params.FacetIndexingParams; import org.apache.lucene.facet.search.FacetsCollector; import org.apache.lucene.facet.search.params.CountFacetRequest; @@ -102,8 +102,7 @@ public class FacetTestUtils { for (int i = 0; i < dirs.length; i++) { IndexTaxonomyWriterPair pair = new IndexTaxonomyWriterPair(); pair.indexWriter = new IndexWriter(dirs[i][0], new IndexWriterConfig( - LuceneTestCase.TEST_VERSION_CURRENT, new StandardAnalyzer( - LuceneTestCase.TEST_VERSION_CURRENT))); + LuceneTestCase.TEST_VERSION_CURRENT, new MockAnalyzer(LuceneTestCase.random()))); pair.taxWriter = new DirectoryTaxonomyWriter(dirs[i][1]); pair.indexWriter.commit(); pair.taxWriter.commit(); diff --git a/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java b/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java index ba704f6213c..cac1fe54447 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/search/TestFacetsCollector.java @@ -3,7 +3,7 @@ package org.apache.lucene.facet.search; import java.util.Collections; import java.util.List; -import org.apache.lucene.analysis.core.KeywordAnalyzer; +import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field.Store; import org.apache.lucene.document.StringField; @@ -53,7 +53,7 @@ public class TestFacetsCollector extends LuceneTestCase { TaxonomyWriter taxonomyWriter = new DirectoryTaxonomyWriter(taxoDir); IndexWriter iw = new IndexWriter(indexDir, new IndexWriterConfig( - TEST_VERSION_CURRENT, new KeywordAnalyzer())); + TEST_VERSION_CURRENT, new MockAnalyzer(random()))); FacetFields facetFields = new FacetFields(taxonomyWriter); for(int i = atLeast(2000); i > 0; --i) {