lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [10/34] lucenenet git commit: Adding parameters to static NewSearcher
Date Fri, 12 Aug 2016 13:20:24 GMT
Adding parameters to static NewSearcher


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/8be2a543
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/8be2a543
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/8be2a543

Branch: refs/heads/lucenenet-indexablefield-api
Commit: 8be2a5433039c6daa114a1632ae2056bd8de148e
Parents: 6614015
Author: Connie Yau <conniey@microsoft.com>
Authored: Fri Jul 22 12:30:36 2016 -0700
Committer: Connie Yau <conniey@microsoft.com>
Committed: Fri Jul 22 12:30:36 2016 -0700

----------------------------------------------------------------------
 .../Util/LuceneTestCase.cs                      | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8be2a543/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index 0910ed8..f729954 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -1003,7 +1003,7 @@ namespace Lucene.Net.Util
             return NewTieredMergePolicy(Random());
         }
 
-        public static AlcoholicMergePolicy NewAlcoholicMergePolicy()
+        public AlcoholicMergePolicy NewAlcoholicMergePolicy()
         {
             return NewAlcoholicMergePolicy(Random(), ClassEnvRule.TimeZone);
         }
@@ -1568,18 +1568,23 @@ namespace Lucene.Net.Util
         /// Create a new searcher over the reader. this searcher might randomly use
         /// threads.
         /// </summary>
-        public static IndexSearcher NewSearcher(IndexReader r)
+        public IndexSearcher NewSearcher(IndexReader r)
         {
-            return NewSearcher(r, true);
+            return NewSearcher(r, true, ClassEnvRule.Similarity);
         }
 
         /// <summary>
         /// Create a new searcher over the reader. this searcher might randomly use
         /// threads.
         /// </summary>
-        public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap)
+        public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap, Similarity
similarity)
         {
-            return NewSearcher(r, maybeWrap, true);
+            return NewSearcher(r, maybeWrap, true, similarity);
+        }
+
+        public IndexSearcher NewSearcher(IndexReader r, bool maybeWrap, bool wrapWithAssertions)
+        {
+            return NewSearcher(r, maybeWrap, wrapWithAssertions, ClassEnvRule.Similarity);
         }
 
         /// <summary>
@@ -1589,7 +1594,7 @@ namespace Lucene.Net.Util
         /// <code>wrapWithAssertions</code> is true, this searcher might be an
         /// <seealso cref="AssertingIndexSearcher"/> instance.
         /// </summary>
-        public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap, bool wrapWithAssertions)
+        public static IndexSearcher NewSearcher(IndexReader r, bool maybeWrap, bool wrapWithAssertions,
Similarity similarity)
         {
             Random random = Random();
             if (Usually())
@@ -1615,7 +1620,7 @@ namespace Lucene.Net.Util
                 {
                     ret = random.NextBoolean() ? new IndexSearcher(r) : new IndexSearcher(r.Context);
                 }
-                ret.Similarity = ClassEnvRule.Similarity;
+                ret.Similarity = similarity;
                 return ret;
             }
             else
@@ -1650,7 +1655,7 @@ namespace Lucene.Net.Util
                 {
                     ret = random.NextBoolean() ? new IndexSearcher(r, ex) : new IndexSearcher(r.Context,
ex);
                 }
-                ret.Similarity = ClassEnvRule.Similarity;
+                ret.Similarity = similarity;
                 return ret;
             }
         }


Mime
View raw message