lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [11/22] lucenenet git commit: Lucene.Net.Queries.Mlt.MoreLikeThis refactor: Boost >ApplyBoost
Date Sat, 28 Jan 2017 10:15:54 GMT
Lucene.Net.Queries.Mlt.MoreLikeThis refactor: Boost >ApplyBoost


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

Branch: refs/heads/api-work
Commit: ee734c71e5f08c1c6c2ec340243346ab565809d1
Parents: 62ea103
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sat Jan 28 09:06:17 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sat Jan 28 09:06:17 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs           | 13 ++++++-------
 src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ee734c71/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
index 4237302..9258ff3 100644
--- a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
+++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
@@ -252,7 +252,7 @@ namespace Lucene.Net.Queries.Mlt
             MinTermFreq = DEFAULT_MIN_TERM_FREQ;
             MinDocFreq = DEFAULT_MIN_DOC_FREQ;
             MaxDocFreq = DEFAULT_MAX_DOC_FREQ;
-            Boost = DEFAULT_BOOST;
+            ApplyBoost = DEFAULT_BOOST;
             FieldNames = DEFAULT_FIELD_NAMES;
             MaxNumTokensParsed = DEFAULT_MAX_NUM_TOKENS_PARSED;
             MinWordLen = DEFAULT_MIN_WORD_LENGTH;
@@ -314,12 +314,11 @@ namespace Lucene.Net.Queries.Mlt
 
 
         /// <summary>
-        /// Returns whether to boost terms in query based on "score" or not. The default
is
-        /// <seealso cref="#DEFAULT_BOOST"/>.
+        /// Gets or Sets whether to boost terms in query based on "score" or not. The default
is
+        /// <see cref="DEFAULT_BOOST"/>.
         /// </summary>
         /// <returns> whether to boost terms in query based on "score" or not. </returns>
-        /// <seealso cref= #setBoost </seealso>
-        public bool Boost { get; set; } // LUCENENET TODO: Rename ApplyBoost ? IsBoost seems
a bit odd
+        public bool ApplyBoost { get; set; }
 
 
         /// <summary>
@@ -412,7 +411,7 @@ namespace Lucene.Net.Queries.Mlt
                 var ar = (object[])cur;
                 var tq = new TermQuery(new Term((string)ar[1], (string)ar[0]));
 
-                if (Boost)
+                if (ApplyBoost)
                 {
                     if (qterms == 0)
                     {
@@ -512,7 +511,7 @@ namespace Lucene.Net.Queries.Mlt
                 delim = ", ";
             }
             sb.Append("\n");
-            sb.Append("\t").Append("boost          : ").Append(Boost).Append("\n");
+            sb.Append("\t").Append("boost          : ").Append(ApplyBoost).Append("\n");
             sb.Append("\t").Append("minTermFreq    : ").Append(MinTermFreq).Append("\n");
             sb.Append("\t").Append("minDocFreq     : ").Append(MinDocFreq).Append("\n");
             return sb.ToString();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ee734c71/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
index bed7c26..665c324 100644
--- a/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
+++ b/src/Lucene.Net.Tests.Queries/Mlt/TestMoreLikeThis.cs
@@ -59,7 +59,7 @@ namespace Lucene.Net.Tests.Queries.Mlt
             mlt.MinTermFreq = 1;
             mlt.MinWordLen = 1;
             mlt.FieldNames = new[] { "text" };
-            mlt.Boost = true;
+            mlt.ApplyBoost = true;
 
             // this mean that every term boost factor will be multiplied by this
             // number
@@ -93,7 +93,7 @@ namespace Lucene.Net.Tests.Queries.Mlt
                 mlt.MinTermFreq = 1;
                 mlt.MinWordLen = 1;
                 mlt.FieldNames = new[] { "text" };
-                mlt.Boost = true;
+                mlt.ApplyBoost = true;
                 BooleanQuery query = (BooleanQuery)mlt.Like(new StringReader("lucene release"),
"text");
                 IList<BooleanClause> clauses = query.Clauses;
 


Mime
View raw message