lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [23/32] lucenenet git commit: Passing Similarity and TimeZone into RandomIndexWriter ctors.
Date Fri, 12 Aug 2016 13:25:36 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs b/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
index 7a3e4eb..1b2ee3a 100644
--- a/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestFilteredQuery.cs
@@ -156,7 +156,7 @@ namespace Lucene.Net.Search
             ScoreDoc[] hits = Searcher.Search(filteredquery, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
             Assert.AreEqual(1, hits[0].Doc);
-            QueryUtils.Check(Random(), filteredquery, Searcher);
+            QueryUtils.Check(Random(), filteredquery, Searcher, Similarity);
 
             hits = Searcher.Search(filteredquery, null, 1000, new Sort(new SortField("sorter", SortField.Type_e.STRING))).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
@@ -165,23 +165,23 @@ namespace Lucene.Net.Search
             filteredquery = new FilteredQuery(new TermQuery(new Term("field", "one")), Filter, RandomFilterStrategy(Random(), useRandomAccess));
             hits = Searcher.Search(filteredquery, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length);
-            QueryUtils.Check(Random(), filteredquery, Searcher);
+            QueryUtils.Check(Random(), filteredquery, Searcher, Similarity);
 
             filteredquery = new FilteredQuery(new MatchAllDocsQuery(), Filter, RandomFilterStrategy(Random(), useRandomAccess));
             hits = Searcher.Search(filteredquery, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length);
-            QueryUtils.Check(Random(), filteredquery, Searcher);
+            QueryUtils.Check(Random(), filteredquery, Searcher, Similarity);
 
             filteredquery = new FilteredQuery(new TermQuery(new Term("field", "x")), Filter, RandomFilterStrategy(Random(), useRandomAccess));
             hits = Searcher.Search(filteredquery, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
             Assert.AreEqual(3, hits[0].Doc);
-            QueryUtils.Check(Random(), filteredquery, Searcher);
+            QueryUtils.Check(Random(), filteredquery, Searcher, Similarity);
 
             filteredquery = new FilteredQuery(new TermQuery(new Term("field", "y")), Filter, RandomFilterStrategy(Random(), useRandomAccess));
             hits = Searcher.Search(filteredquery, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length);
-            QueryUtils.Check(Random(), filteredquery, Searcher);
+            QueryUtils.Check(Random(), filteredquery, Searcher, Similarity);
 
             // test boost
             Filter f = NewStaticFilterA();
@@ -259,7 +259,7 @@ namespace Lucene.Net.Search
             Query filteredquery = new FilteredQuery(rq, Filter, RandomFilterStrategy(Random(), useRandomAccess));
             ScoreDoc[] hits = Searcher.Search(filteredquery, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length);
-            QueryUtils.Check(Random(), filteredquery, Searcher);
+            QueryUtils.Check(Random(), filteredquery, Searcher, Similarity);
         }
 
         [Test]
@@ -280,7 +280,7 @@ namespace Lucene.Net.Search
             bq.Add(query, BooleanClause.Occur.MUST);
             ScoreDoc[] hits = Searcher.Search(bq, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length);
-            QueryUtils.Check(Random(), query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         [Test]
@@ -301,7 +301,7 @@ namespace Lucene.Net.Search
             bq.Add(query, BooleanClause.Occur.SHOULD);
             ScoreDoc[] hits = Searcher.Search(bq, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length);
-            QueryUtils.Check(Random(), query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         // Make sure BooleanQuery, which does out-of-order
@@ -323,7 +323,7 @@ namespace Lucene.Net.Search
             bq.Add(new TermQuery(new Term("field", "two")), BooleanClause.Occur.SHOULD);
             ScoreDoc[] hits = Searcher.Search(query, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
-            QueryUtils.Check(Random(), query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         [Test]
@@ -340,13 +340,13 @@ namespace Lucene.Net.Search
             Query query = new FilteredQuery(new FilteredQuery(new MatchAllDocsQuery(), new CachingWrapperFilter(new QueryWrapperFilter(new TermQuery(new Term("field", "three")))), RandomFilterStrategy(Random(), useRandomAccess)), new CachingWrapperFilter(new QueryWrapperFilter(new TermQuery(new Term("field", "four")))), RandomFilterStrategy(Random(), useRandomAccess));
             ScoreDoc[] hits = Searcher.Search(query, 10).ScoreDocs;
             Assert.AreEqual(2, hits.Length);
-            QueryUtils.Check(Random(), query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // one more:
             query = new FilteredQuery(query, new CachingWrapperFilter(new QueryWrapperFilter(new TermQuery(new Term("field", "five")))), RandomFilterStrategy(Random(), useRandomAccess));
             hits = Searcher.Search(query, 10).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
-            QueryUtils.Check(Random(), query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         [Test]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs b/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
index f6e5977..61e94de 100644
--- a/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestFuzzyQuery.cs
@@ -46,7 +46,7 @@ namespace Lucene.Net.Search
         public virtual void TestFuzziness()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             AddDoc("aaaaa", writer);
             AddDoc("aaaab", writer);
             AddDoc("aaabb", writer);
@@ -200,7 +200,7 @@ namespace Lucene.Net.Search
         public virtual void Test2()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, new MockAnalyzer(Random(), MockTokenizer.KEYWORD, false));
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, new MockAnalyzer(Random(), MockTokenizer.KEYWORD, false), Similarity, TimeZone);
             AddDoc("LANGE", writer);
             AddDoc("LUETH", writer);
             AddDoc("PIRSING", writer);
@@ -244,14 +244,14 @@ namespace Lucene.Net.Search
         public virtual void TestTieBreaker()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             AddDoc("a123456", writer);
             AddDoc("c123456", writer);
             AddDoc("d123456", writer);
             AddDoc("e123456", writer);
 
             Directory directory2 = NewDirectory();
-            RandomIndexWriter writer2 = new RandomIndexWriter(Random(), directory2);
+            RandomIndexWriter writer2 = new RandomIndexWriter(Random(), directory2, Similarity, TimeZone);
             AddDoc("a123456", writer2);
             AddDoc("b123456", writer2);
             AddDoc("b123456", writer2);
@@ -282,7 +282,7 @@ namespace Lucene.Net.Search
         public virtual void TestBoostOnlyRewrite()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             AddDoc("Lucene", writer);
             AddDoc("Lucene", writer);
             AddDoc("Lucenne", writer);
@@ -308,7 +308,7 @@ namespace Lucene.Net.Search
         {
             MockAnalyzer analyzer = new MockAnalyzer(Random());
             Directory index = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), index);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), index, Similarity, TimeZone);
 
             AddDoc("Lucene in Action", w);
             AddDoc("Lucene for Dummies", w);
@@ -345,7 +345,7 @@ namespace Lucene.Net.Search
         public virtual void TestDistanceAsEditsSearching()
         {
             Directory index = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), index);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), index, Similarity, TimeZone);
             AddDoc("foobar", w);
             AddDoc("test", w);
             AddDoc("working", w);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestIndexSearcher.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestIndexSearcher.cs b/src/Lucene.Net.Tests/core/Search/TestIndexSearcher.cs
index f16306d..335924e 100644
--- a/src/Lucene.Net.Tests/core/Search/TestIndexSearcher.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestIndexSearcher.cs
@@ -41,7 +41,7 @@ namespace Lucene.Net.Search
         {
             base.SetUp();
             Dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), Dir, Similarity, TimeZone);
             for (int i = 0; i < 100; i++)
             {
                 Document doc = new Document();
@@ -117,7 +117,7 @@ namespace Lucene.Net.Search
         {
             // LUCENE-5128: ensure we get a meaningful message if searchAfter exceeds maxDoc
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             w.AddDocument(new Document());
             IndexReader r = w.Reader;
             w.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestMinShouldMatch2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestMinShouldMatch2.cs b/src/Lucene.Net.Tests/core/Search/TestMinShouldMatch2.cs
index 312bc2a..33aec6e 100644
--- a/src/Lucene.Net.Tests/core/Search/TestMinShouldMatch2.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestMinShouldMatch2.cs
@@ -61,10 +61,10 @@ namespace Lucene.Net.Search
         internal static readonly string[] RareTerms = new string[] { "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
 
         [TestFixtureSetUp]
-        public static void BeforeClass()
+        public void BeforeClass()
         {
             Dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), Dir, Similarity, TimeZone);
             int numDocs = AtLeast(300);
             for (int i = 0; i < numDocs; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs b/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
index 82f15e6..6482ace 100644
--- a/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestMultiPhraseQuery.cs
@@ -55,7 +55,7 @@ namespace Lucene.Net.Search
         public virtual void TestPhrasePrefix()
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("blueberry pie", writer);
             Add("blueberry strudel", writer);
             Add("blueberry pizza", writer);
@@ -157,7 +157,7 @@ namespace Lucene.Net.Search
         public virtual void TestTall()
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("blueberry chocolate pie", writer);
             Add("blueberry chocolate tart", writer);
             IndexReader r = writer.Reader;
@@ -179,7 +179,7 @@ namespace Lucene.Net.Search
         public virtual void TestMultiSloppyWithRepeats() //LUCENE-3821 fixes sloppy phrase scoring, except for this known problem
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("a b c d e f g h i k", writer);
             IndexReader r = writer.Reader;
             writer.Dispose();
@@ -201,7 +201,7 @@ namespace Lucene.Net.Search
         public virtual void TestMultiExactWithRepeats()
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("a b c d e f g h i k", writer);
             IndexReader r = writer.Reader;
             writer.Dispose();
@@ -230,7 +230,7 @@ namespace Lucene.Net.Search
             // and all terms required.
             // The contained PhraseMultiQuery must contain exactly one term array.
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("blueberry pie", writer);
             Add("blueberry chewing gum", writer);
             Add("blue raspberry pie", writer);
@@ -262,7 +262,7 @@ namespace Lucene.Net.Search
         public virtual void TestPhrasePrefixWithBooleanQuery()
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("this is a test", "object", writer);
             Add("a note", "note", writer);
 
@@ -290,7 +290,7 @@ namespace Lucene.Net.Search
         public virtual void TestNoDocs()
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("a note", "note", writer);
 
             IndexReader reader = writer.Reader;
@@ -359,7 +359,7 @@ namespace Lucene.Net.Search
         public virtual void TestCustomIDF()
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Add("this is a test", "object", writer);
             Add("a note", "note", writer);
 
@@ -408,7 +408,7 @@ namespace Lucene.Net.Search
             tokens[2].Append("c");
             tokens[2].PositionIncrement = 0;
 
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(new TextField("field", new CannedTokenStream(tokens)));
             writer.AddDocument(doc);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestMultiTermQueryRewrites.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestMultiTermQueryRewrites.cs b/src/Lucene.Net.Tests/core/Search/TestMultiTermQueryRewrites.cs
index 1fc0a89..0705a83 100644
--- a/src/Lucene.Net.Tests/core/Search/TestMultiTermQueryRewrites.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestMultiTermQueryRewrites.cs
@@ -51,9 +51,9 @@ namespace Lucene.Net.Search
             Dir = NewDirectory();
             Sdir1 = NewDirectory();
             Sdir2 = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), Dir, new MockAnalyzer(Random()));
-            RandomIndexWriter swriter1 = new RandomIndexWriter(Random(), Sdir1, new MockAnalyzer(Random()));
-            RandomIndexWriter swriter2 = new RandomIndexWriter(Random(), Sdir2, new MockAnalyzer(Random()));
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), Dir, new MockAnalyzer(Random()), Similarity, TimeZone);
+            RandomIndexWriter swriter1 = new RandomIndexWriter(Random(), Sdir1, new MockAnalyzer(Random()), Similarity, TimeZone);
+            RandomIndexWriter swriter2 = new RandomIndexWriter(Random(), Sdir2, new MockAnalyzer(Random()), Similarity, TimeZone);
 
             for (int i = 0; i < 10; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestNGramPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestNGramPhraseQuery.cs b/src/Lucene.Net.Tests/core/Search/TestNGramPhraseQuery.cs
index c7f05e5..3db7193 100644
--- a/src/Lucene.Net.Tests/core/Search/TestNGramPhraseQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestNGramPhraseQuery.cs
@@ -33,10 +33,10 @@ namespace Lucene.Net.Search
         private static Directory Directory;
 
         [TestFixtureSetUp]
-        public static void BeforeClass()
+        public void BeforeClass()
         {
             Directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), Directory, Similarity, TimeZone);
             writer.Dispose();
             Reader = DirectoryReader.Open(Directory);
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestNot.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestNot.cs b/src/Lucene.Net.Tests/core/Search/TestNot.cs
index 6eb82a3..041a79e 100644
--- a/src/Lucene.Net.Tests/core/Search/TestNot.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestNot.cs
@@ -41,7 +41,7 @@ namespace Lucene.Net.Search
         public virtual void TestNot_Mem()
         {
             Directory store = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), store);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), store, Similarity, TimeZone);
 
             Document d1 = new Document();
             d1.Add(NewTextField("field", "a b", Field.Store.YES));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery32.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery32.cs b/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery32.cs
index 4975180..8c26b24 100644
--- a/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery32.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery32.cs
@@ -62,7 +62,7 @@ namespace Lucene.Net.Search
         private static IndexSearcher Searcher = null;
 
         [TestFixtureSetUp]
-        public static void BeforeClass()
+        public void BeforeClass()
         {
             NoDocs = AtLeast(4096);
             Distance = (1 << 30) / NoDocs;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery64.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery64.cs b/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery64.cs
index 4d0ce31..d55bd45 100644
--- a/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery64.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestNumericRangeQuery64.cs
@@ -62,7 +62,7 @@ namespace Lucene.Net.Search
         private static IndexSearcher Searcher = null;
 
         [TestFixtureSetUp]
-        public static void BeforeClass()
+        public void BeforeClass()
         {
             NoDocs = AtLeast(4096);
             Distance = (1L << 60) / NoDocs;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs b/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
index 4281469..462e6d8 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPhrasePrefixQuery.cs
@@ -45,7 +45,7 @@ namespace Lucene.Net.Search
         public virtual void TestPhrasePrefix()
         {
             Directory indexStore = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), indexStore, Similarity, TimeZone);
             Document doc1 = new Document();
             Document doc2 = new Document();
             Document doc3 = new Document();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPhraseQuery.cs b/src/Lucene.Net.Tests/core/Search/TestPhraseQuery.cs
index ec8cd62..812d0ed 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPhraseQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPhraseQuery.cs
@@ -60,7 +60,7 @@ namespace Lucene.Net.Search
         {
             Directory = NewDirectory();
             Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), Directory, analyzer);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), Directory, analyzer, Similarity, TimeZone);
 
             Documents.Document doc = new Documents.Document();
             doc.Add(NewTextField("field", "one two three four five", Field.Store.YES));
@@ -126,7 +126,7 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "five"));
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         [Test]
@@ -137,7 +137,7 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "five"));
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         /// <summary>
@@ -151,14 +151,14 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "five"));
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length, "exact match");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             Query = new PhraseQuery();
             Query.Add(new Term("field", "two"));
             Query.Add(new Term("field", "one"));
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length, "reverse not exact");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         [Test]
@@ -170,7 +170,7 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "two"));
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length, "in order");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // Ensures slop of 1 does not work for phrases out of order;
             // must be at least 2.
@@ -180,7 +180,7 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "one"));
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length, "reversed, slop not 2 or more");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         /// <summary>
@@ -194,7 +194,7 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "one"));
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length, "just sloppy enough");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             Query = new PhraseQuery();
             Query.Slop = 2;
@@ -202,7 +202,7 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "one"));
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length, "not sloppy enough");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         /// <summary>
@@ -218,7 +218,7 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "five"));
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length, "two total moves");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             Query = new PhraseQuery();
             Query.Slop = 5; // it takes six moves to match this phrase
@@ -227,12 +227,12 @@ namespace Lucene.Net.Search
             Query.Add(new Term("field", "one"));
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length, "slop of 5 not close enough");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             Query.Slop = 6;
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length, "slop of 6 just right");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         [Test]
@@ -255,7 +255,7 @@ namespace Lucene.Net.Search
             query.Add(new Term("field", "words"));
             ScoreDoc[] hits = searcher.Search(query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
-            QueryUtils.Check(Random(), query, searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             reader.Dispose();
             directory.Dispose();
@@ -265,7 +265,7 @@ namespace Lucene.Net.Search
         public virtual void TestPhraseQueryInConjunctionScorer()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
 
             Documents.Document doc = new Documents.Document();
             doc.Add(NewTextField("source", "marketing info", Field.Store.YES));
@@ -286,7 +286,7 @@ namespace Lucene.Net.Search
             phraseQuery.Add(new Term("source", "info"));
             ScoreDoc[] hits = searcher.Search(phraseQuery, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length);
-            QueryUtils.Check(Random(), phraseQuery, searcher);
+            QueryUtils.Check(Random(), phraseQuery, searcher, Similarity);
 
             TermQuery termQuery = new TermQuery(new Term("contents", "foobar"));
             BooleanQuery booleanQuery = new BooleanQuery();
@@ -294,7 +294,7 @@ namespace Lucene.Net.Search
             booleanQuery.Add(phraseQuery, BooleanClause.Occur.MUST);
             hits = searcher.Search(booleanQuery, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length);
-            QueryUtils.Check(Random(), termQuery, searcher);
+            QueryUtils.Check(Random(), termQuery, searcher, Similarity);
 
             reader.Dispose();
 
@@ -337,7 +337,7 @@ namespace Lucene.Net.Search
             booleanQuery.Add(termQuery, BooleanClause.Occur.MUST);
             hits = searcher.Search(booleanQuery, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length);
-            QueryUtils.Check(Random(), booleanQuery, searcher);
+            QueryUtils.Check(Random(), booleanQuery, searcher, Similarity);
 
             reader.Dispose();
             directory.Dispose();
@@ -380,7 +380,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(1, hits[1].Doc);
             Assert.AreEqual(0.31, hits[2].Score, 0.01);
             Assert.AreEqual(2, hits[2].Doc);
-            QueryUtils.Check(Random(), query, searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
             reader.Dispose();
             directory.Dispose();
         }
@@ -408,13 +408,13 @@ namespace Lucene.Net.Search
 
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(1, hits.Length, "slop of 100 just right");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             Query.Slop = 99;
 
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length, "slop of 99 not enough");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         // work on two docs like this: "phrase exist notexist exist found"
@@ -429,7 +429,7 @@ namespace Lucene.Net.Search
 
             ScoreDoc[] hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length, "phrase without repetitions exists in 2 docs");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // phrase with repetitions that exists in 2 docs
             Query = new PhraseQuery();
@@ -440,7 +440,7 @@ namespace Lucene.Net.Search
 
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(2, hits.Length, "phrase with repetitions exists in two docs");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // phrase I with repetitions that does not exist in any doc
             Query = new PhraseQuery();
@@ -451,7 +451,7 @@ namespace Lucene.Net.Search
 
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length, "nonexisting phrase with repetitions does not exist in any doc");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // phrase II with repetitions that does not exist in any doc
             Query = new PhraseQuery();
@@ -463,7 +463,7 @@ namespace Lucene.Net.Search
 
             hits = Searcher.Search(Query, null, 1000).ScoreDocs;
             Assert.AreEqual(0, hits.Length, "nonexisting phrase with repetitions does not exist in any doc");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
         }
 
         /// <summary>
@@ -486,7 +486,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(1, hits.Length, "phrase found with exact phrase scorer");
             float score0 = hits[0].Score;
             //System.out.println("(exact) field: two three: "+score0);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // search on non palyndrome, find phrase with slop 2, though no slop required here.
             Query.Slop = 2; // to use sloppy scorer
@@ -495,7 +495,7 @@ namespace Lucene.Net.Search
             float score1 = hits[0].Score;
             //System.out.println("(sloppy) field: two three: "+score1);
             Assert.AreEqual(score0, score1, SCORE_COMP_THRESH, "exact scorer and sloppy scorer score the same when slop does not matter");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // search ordered in palyndrome, find it twice
             Query = new PhraseQuery();
@@ -506,7 +506,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(1, hits.Length, "just sloppy enough");
             //float score2 = hits[0].Score;
             //System.out.println("palindrome: two three: "+score2);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             //commented out for sloppy-phrase efficiency (issue 736) - see SloppyPhraseScorer.phraseFreq().
             //Assert.IsTrue("ordered scores higher in palindrome",score1+SCORE_COMP_THRESH<score2);
@@ -520,7 +520,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(1, hits.Length, "just sloppy enough");
             //float score3 = hits[0].Score;
             //System.out.println("palindrome: three two: "+score3);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             //commented out for sloppy-phrase efficiency (issue 736) - see SloppyPhraseScorer.phraseFreq().
             //Assert.IsTrue("reversed scores higher in palindrome",score1+SCORE_COMP_THRESH<score3);
@@ -548,7 +548,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(1, hits.Length, "phrase found with exact phrase scorer");
             float score0 = hits[0].Score;
             //System.out.println("(exact) field: one two three: "+score0);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // just make sure no exc:
             Searcher.Explain(Query, 0);
@@ -560,7 +560,7 @@ namespace Lucene.Net.Search
             float score1 = hits[0].Score;
             //System.out.println("(sloppy) field: one two three: "+score1);
             Assert.AreEqual(score0, score1, SCORE_COMP_THRESH, "exact scorer and sloppy scorer score the same when slop does not matter");
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             // search ordered in palyndrome, find it twice
             Query = new PhraseQuery();
@@ -576,7 +576,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(1, hits.Length, "just sloppy enough");
             //float score2 = hits[0].Score;
             //System.out.println("palindrome: one two three: "+score2);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             //commented out for sloppy-phrase efficiency (issue 736) - see SloppyPhraseScorer.phraseFreq().
             //Assert.IsTrue("ordered scores higher in palindrome",score1+SCORE_COMP_THRESH<score2);
@@ -591,7 +591,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(1, hits.Length, "just sloppy enough");
             //float score3 = hits[0].Score;
             //System.out.println("palindrome: three two one: "+score3);
-            QueryUtils.Check(Random(), Query, Searcher);
+            QueryUtils.Check(Random(), Query, Searcher, Similarity);
 
             //commented out for sloppy-phrase efficiency (issue 736) - see SloppyPhraseScorer.phraseFreq().
             //Assert.IsTrue("reversed scores higher in palindrome",score1+SCORE_COMP_THRESH<score3);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestPositionIncrement.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPositionIncrement.cs b/src/Lucene.Net.Tests/core/Search/TestPositionIncrement.cs
index a953b6a..3f133b7 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPositionIncrement.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPositionIncrement.cs
@@ -60,7 +60,7 @@ namespace Lucene.Net.Search
         {
             Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
             Directory store = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), store, analyzer);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), store, analyzer, Similarity, TimeZone);
             Document d = new Document();
             d.Add(NewTextField("field", "bogus", Field.Store.YES));
             writer.AddDocument(d);
@@ -230,7 +230,7 @@ namespace Lucene.Net.Search
         public virtual void TestPayloadsPos0()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, new MockPayloadAnalyzer());
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, new MockPayloadAnalyzer(), Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(new TextField("content", new StringReader("a a b c d e a f g h i j a b k k")));
             writer.AddDocument(doc);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestPositiveScoresOnlyCollector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPositiveScoresOnlyCollector.cs b/src/Lucene.Net.Tests/core/Search/TestPositiveScoresOnlyCollector.cs
index f3461ea..5d65126 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPositiveScoresOnlyCollector.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPositiveScoresOnlyCollector.cs
@@ -90,7 +90,7 @@ namespace Lucene.Net.Search
             }
 
             Directory directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             writer.Commit();
             IndexReader ir = writer.Reader;
             writer.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestPrefixFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPrefixFilter.cs b/src/Lucene.Net.Tests/core/Search/TestPrefixFilter.cs
index 6e33a0b..4e812e6 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPrefixFilter.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPrefixFilter.cs
@@ -42,7 +42,7 @@ namespace Lucene.Net.Search
             Directory directory = NewDirectory();
 
             string[] categories = new string[] { "/Computers/Linux", "/Computers/Mac/One", "/Computers/Mac/Two", "/Computers/Windows" };
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             for (int i = 0; i < categories.Length; i++)
             {
                 Document doc = new Document();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestPrefixInBooleanQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPrefixInBooleanQuery.cs b/src/Lucene.Net.Tests/core/Search/TestPrefixInBooleanQuery.cs
index f0a291b..99b40e6 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPrefixInBooleanQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPrefixInBooleanQuery.cs
@@ -50,7 +50,7 @@ namespace Lucene.Net.Search
         public void BeforeClass()
         {
             Directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), Directory, Similarity, TimeZone);
 
             Document doc = new Document();
             Field field = NewStringField(FIELD, "meaninglessnames", Field.Store.NO);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestPrefixQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestPrefixQuery.cs b/src/Lucene.Net.Tests/core/Search/TestPrefixQuery.cs
index fd5b85a..5f4719a 100644
--- a/src/Lucene.Net.Tests/core/Search/TestPrefixQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestPrefixQuery.cs
@@ -44,7 +44,7 @@ namespace Lucene.Net.Search
             Directory directory = NewDirectory();
 
             string[] categories = new string[] { "/Computers", "/Computers/Mac", "/Computers/Windows" };
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             for (int i = 0; i < categories.Length; i++)
             {
                 Document doc = new Document();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestQueryRescorer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestQueryRescorer.cs b/src/Lucene.Net.Tests/core/Search/TestQueryRescorer.cs
index b9ab94b..f7dfd3e 100644
--- a/src/Lucene.Net.Tests/core/Search/TestQueryRescorer.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestQueryRescorer.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Search
         public virtual void TestBasic()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(NewStringField("id", "0", Field.Store.YES));
@@ -120,7 +120,7 @@ namespace Lucene.Net.Search
         public virtual void TestCustomCombine()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(NewStringField("id", "0", Field.Store.YES));
@@ -189,7 +189,7 @@ namespace Lucene.Net.Search
         public virtual void TestExplain()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(NewStringField("id", "0", Field.Store.YES));
@@ -277,7 +277,7 @@ namespace Lucene.Net.Search
         public virtual void TestMissingSecondPassScore()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Document doc = new Document();
             doc.Add(NewStringField("id", "0", Field.Store.YES));
@@ -335,7 +335,7 @@ namespace Lucene.Net.Search
         {
             Directory dir = NewDirectory();
             int numDocs = AtLeast(1000);
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             int[] idToNum = new int[numDocs];
             int maxValue = TestUtil.NextInt(Random(), 10, 1000000);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestQueryWrapperFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestQueryWrapperFilter.cs b/src/Lucene.Net.Tests/core/Search/TestQueryWrapperFilter.cs
index 1de5e61..c61e090 100644
--- a/src/Lucene.Net.Tests/core/Search/TestQueryWrapperFilter.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestQueryWrapperFilter.cs
@@ -39,7 +39,7 @@ namespace Lucene.Net.Search
         public virtual void TestBasic()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewTextField("field", "value", Field.Store.NO));
             writer.AddDocument(doc);
@@ -92,7 +92,7 @@ namespace Lucene.Net.Search
         public virtual void TestRandom()
         {
             Directory d = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), d);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), d, Similarity, TimeZone);
             w.w.Config.SetMaxBufferedDocs(17);
             int numDocs = AtLeast(100);
             HashSet<string> aDocs = new HashSet<string>();
@@ -139,7 +139,7 @@ namespace Lucene.Net.Search
         public virtual void TestThousandDocuments()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             for (int i = 0; i < 1000; i++)
             {
                 Document doc = new Document();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestRegexpQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestRegexpQuery.cs b/src/Lucene.Net.Tests/core/Search/TestRegexpQuery.cs
index fc7ebcc..cea926a 100644
--- a/src/Lucene.Net.Tests/core/Search/TestRegexpQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestRegexpQuery.cs
@@ -51,7 +51,7 @@ namespace Lucene.Net.Search
         {
             base.SetUp();
             Directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), Directory, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewTextField(FN, "the quick brown fox jumps over the lazy ??? dog 493432 49344", Field.Store.NO));
             writer.AddDocument(doc);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs b/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
index 616ca1d..68dc1ef 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSameScoresWithThreads.cs
@@ -48,7 +48,7 @@ namespace Lucene.Net.Search
             Directory dir = NewDirectory();
             MockAnalyzer analyzer = new MockAnalyzer(Random());
             analyzer.MaxTokenLength = TestUtil.NextInt(Random(), 1, IndexWriter.MAX_TERM_LENGTH);
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, analyzer, Similarity, TimeZone);
             LineFileDocs docs = new LineFileDocs(Random(), DefaultCodecSupportsDocValues());
             int charsToIndex = AtLeast(100000);
             int charsIndexed = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestScoreCachingWrappingScorer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestScoreCachingWrappingScorer.cs b/src/Lucene.Net.Tests/core/Search/TestScoreCachingWrappingScorer.cs
index 42cef6e..caa5b2a 100644
--- a/src/Lucene.Net.Tests/core/Search/TestScoreCachingWrappingScorer.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestScoreCachingWrappingScorer.cs
@@ -128,7 +128,7 @@ namespace Lucene.Net.Search
         public virtual void TestGetScores()
         {
             Directory directory = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), directory, Similarity, TimeZone);
             writer.Commit();
             IndexReader ir = writer.Reader;
             writer.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs b/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
index e76a79d..93d3414 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
@@ -121,7 +121,7 @@ namespace Lucene.Net.Search
             }
 
             Dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), Dir, Similarity, TimeZone);
             int numDocs = AtLeast(200);
             for (int i = 0; i < numDocs; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestSearchWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSearchWithThreads.cs b/src/Lucene.Net.Tests/core/Search/TestSearchWithThreads.cs
index ed6f1df..6557fc7 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSearchWithThreads.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSearchWithThreads.cs
@@ -52,7 +52,7 @@ namespace Lucene.Net.Search
         public virtual void Test()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             long startTime = Environment.TickCount;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestSearcherManager.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSearcherManager.cs b/src/Lucene.Net.Tests/core/Search/TestSearcherManager.cs
index 97c862c..240f310 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSearcherManager.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSearcherManager.cs
@@ -529,7 +529,7 @@ namespace Lucene.Net.Search
         {
             Random random = Random();
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(random, dir);
+            RandomIndexWriter w = new RandomIndexWriter(random, dir, Similarity, TimeZone);
             w.Commit();
 
             IndexReader other = DirectoryReader.Open(dir);
@@ -571,7 +571,7 @@ namespace Lucene.Net.Search
 
             public override IndexSearcher NewSearcher(IndexReader ignored)
             {
-                return LuceneTestCase.NewSearcher(Other);
+                return OuterInstance.NewSearcher(Other);
             }
         }
 
@@ -581,7 +581,7 @@ namespace Lucene.Net.Search
             // make sure that maybeRefreshBlocking releases the lock, otherwise other
             // threads cannot obtain it.
             Directory dir = NewDirectory();
-            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             w.Dispose();
 
             SearcherManager sm = new SearcherManager(dir, null);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestSloppyPhraseQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSloppyPhraseQuery.cs b/src/Lucene.Net.Tests/core/Search/TestSloppyPhraseQuery.cs
index 5cf923c..17d04bc 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSloppyPhraseQuery.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSloppyPhraseQuery.cs
@@ -164,7 +164,7 @@ namespace Lucene.Net.Search
             query.Slop = slop;
 
             Directory ramDir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), ramDir, new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false));
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), ramDir, new MockAnalyzer(Random(), MockTokenizer.WHITESPACE, false), Similarity, TimeZone);
             writer.AddDocument(doc);
 
             IndexReader reader = writer.Reader;
@@ -243,7 +243,7 @@ namespace Lucene.Net.Search
         private void AssertSaneScoring(PhraseQuery pq, IndexSearcher searcher)
         {
             searcher.Search(pq, new CollectorAnonymousInnerClassHelper(this));
-            QueryUtils.Check(Random(), pq, searcher);
+            QueryUtils.Check(Random(), pq, searcher, Similarity);
         }
 
         private class CollectorAnonymousInnerClassHelper : Collector
@@ -290,7 +290,7 @@ namespace Lucene.Net.Search
         public virtual void TestSlopWithHoles()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             FieldType customType = new FieldType(TextField.TYPE_NOT_STORED);
             customType.OmitNorms = true;
             Field f = new Field("lyrics", "", customType);
@@ -329,7 +329,7 @@ namespace Lucene.Net.Search
             string document = "drug druggy drug drug drug";
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewField("lyrics", document, new FieldType(TextField.TYPE_NOT_STORED)));
             iw.AddDocument(doc);
@@ -355,7 +355,7 @@ namespace Lucene.Net.Search
 
             Directory dir = NewDirectory();
 
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewField("lyrics", document, new FieldType(TextField.TYPE_NOT_STORED)));
             iw.AddDocument(doc);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c8e1eae6/src/Lucene.Net.Tests/core/Search/TestSort.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSort.cs b/src/Lucene.Net.Tests/core/Search/TestSort.cs
index 29991d1..01c9d97 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSort.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSort.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Search
         public virtual void TestString()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "foo", Field.Store.YES));
             writer.AddDocument(doc);
@@ -98,7 +98,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -130,7 +130,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "bar", Field.Store.YES));
             writer.AddDocument(doc);
@@ -159,7 +159,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringVal()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "foo", Field.Store.YES));
             writer.AddDocument(doc);
@@ -188,7 +188,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringValMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -222,7 +222,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringMissingSortedFirst()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -257,7 +257,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringMissingSortedFirstReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -292,7 +292,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringValMissingSortedLast()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -328,7 +328,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringValMissingSortedLastReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -362,7 +362,7 @@ namespace Lucene.Net.Search
         public virtual void TestStringValReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "bar", Field.Store.YES));
             writer.AddDocument(doc);
@@ -391,7 +391,7 @@ namespace Lucene.Net.Search
         public virtual void TestFieldDoc()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "foo", Field.Store.NO));
             writer.AddDocument(doc);
@@ -420,7 +420,7 @@ namespace Lucene.Net.Search
         public virtual void TestFieldDocReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "foo", Field.Store.NO));
             writer.AddDocument(doc);
@@ -449,7 +449,7 @@ namespace Lucene.Net.Search
         public virtual void TestFieldScore()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewTextField("value", "foo bar bar bar bar", Field.Store.NO));
             writer.AddDocument(doc);
@@ -483,7 +483,7 @@ namespace Lucene.Net.Search
         public virtual void TestFieldScoreReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewTextField("value", "foo bar bar bar bar", Field.Store.NO));
             writer.AddDocument(doc);
@@ -515,7 +515,7 @@ namespace Lucene.Net.Search
         public virtual void TestByte()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "23", Field.Store.YES));
             writer.AddDocument(doc);
@@ -548,7 +548,7 @@ namespace Lucene.Net.Search
         public virtual void TestByteMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -580,7 +580,7 @@ namespace Lucene.Net.Search
         public virtual void TestByteMissingLast()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -614,7 +614,7 @@ namespace Lucene.Net.Search
         public virtual void TestByteReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "23", Field.Store.YES));
             writer.AddDocument(doc);
@@ -647,7 +647,7 @@ namespace Lucene.Net.Search
         public virtual void TestShort()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "300", Field.Store.YES));
             writer.AddDocument(doc);
@@ -680,7 +680,7 @@ namespace Lucene.Net.Search
         public virtual void TestShortMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -712,7 +712,7 @@ namespace Lucene.Net.Search
         public virtual void TestShortMissingLast()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -746,7 +746,7 @@ namespace Lucene.Net.Search
         public virtual void TestShortReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "300", Field.Store.YES));
             writer.AddDocument(doc);
@@ -779,7 +779,7 @@ namespace Lucene.Net.Search
         public virtual void TestInt()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "300000", Field.Store.YES));
             writer.AddDocument(doc);
@@ -812,7 +812,7 @@ namespace Lucene.Net.Search
         public virtual void TestIntMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -844,7 +844,7 @@ namespace Lucene.Net.Search
         public virtual void TestIntMissingLast()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -878,7 +878,7 @@ namespace Lucene.Net.Search
         public virtual void TestIntReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "300000", Field.Store.YES));
             writer.AddDocument(doc);
@@ -911,7 +911,7 @@ namespace Lucene.Net.Search
         public virtual void TestLong()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "3000000000", Field.Store.YES));
             writer.AddDocument(doc);
@@ -944,7 +944,7 @@ namespace Lucene.Net.Search
         public virtual void TestLongMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -976,7 +976,7 @@ namespace Lucene.Net.Search
         public virtual void TestLongMissingLast()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -1010,7 +1010,7 @@ namespace Lucene.Net.Search
         public virtual void TestLongReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "3000000000", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1043,7 +1043,7 @@ namespace Lucene.Net.Search
         public virtual void TestFloat()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "30.1", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1076,7 +1076,7 @@ namespace Lucene.Net.Search
         public virtual void TestFloatMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -1108,7 +1108,7 @@ namespace Lucene.Net.Search
         public virtual void TestFloatMissingLast()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -1142,7 +1142,7 @@ namespace Lucene.Net.Search
         public virtual void TestFloatReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "30.1", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1175,7 +1175,7 @@ namespace Lucene.Net.Search
         public virtual void TestDouble()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "30.1", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1212,7 +1212,7 @@ namespace Lucene.Net.Search
         public virtual void TestDoubleSignedZero()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "+0", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1242,7 +1242,7 @@ namespace Lucene.Net.Search
         public virtual void TestDoubleMissing()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -1278,7 +1278,7 @@ namespace Lucene.Net.Search
         public virtual void TestDoubleMissingLast()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             writer.AddDocument(doc);
             doc = new Document();
@@ -1316,7 +1316,7 @@ namespace Lucene.Net.Search
         public virtual void TestDoubleReverse()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "30.1", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1480,7 +1480,7 @@ namespace Lucene.Net.Search
             letters = (List<string>)CollectionsHelper.Shuffle(letters);
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             foreach (string letter in letters)
             {
                 Document doc = new Document();
@@ -1537,7 +1537,7 @@ namespace Lucene.Net.Search
             letters = (List<string>)CollectionsHelper.Shuffle(letters);
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             foreach (string letter in letters)
             {
                 Document doc = new Document();
@@ -1595,7 +1595,7 @@ namespace Lucene.Net.Search
             letters = (List<string>)CollectionsHelper.Shuffle(letters);
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             foreach (string letter in letters)
             {
                 Document doc = new Document();
@@ -1652,7 +1652,7 @@ namespace Lucene.Net.Search
             letters = (List<string>)CollectionsHelper.Shuffle(letters);
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             foreach (string letter in letters)
             {
                 Document doc = new Document();
@@ -1709,7 +1709,7 @@ namespace Lucene.Net.Search
             letters = (List<string>)CollectionsHelper.Shuffle(letters);
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             foreach (string letter in letters)
             {
                 Document doc = new Document();
@@ -1767,7 +1767,7 @@ namespace Lucene.Net.Search
             letters = (List<string>)CollectionsHelper.Shuffle(letters);
 
             Directory dir = NewDirectory();
-            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter iw = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             foreach (string letter in letters)
             {
                 Document doc = new Document();
@@ -1821,7 +1821,7 @@ namespace Lucene.Net.Search
         public virtual void TestSortOneDocument()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "foo", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1845,7 +1845,7 @@ namespace Lucene.Net.Search
         public virtual void TestSortOneDocumentWithScores()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "foo", Field.Store.YES));
             writer.AddDocument(doc);
@@ -1872,7 +1872,7 @@ namespace Lucene.Net.Search
         public virtual void TestSortTwoFields()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("tievalue", "tied", Field.Store.NO));
             doc.Add(NewStringField("value", "foo", Field.Store.YES));
@@ -1902,7 +1902,7 @@ namespace Lucene.Net.Search
         public virtual void TestScore()
         {
             Directory dir = NewDirectory();
-            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, ClassEnvRule.Similarity, ClassEnvRule.TimeZone);
+            RandomIndexWriter writer = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
             Document doc = new Document();
             doc.Add(NewStringField("value", "bar", Field.Store.NO));
             writer.AddDocument(doc);


Mime
View raw message