You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kr...@apache.org on 2016/10/20 19:31:55 UTC

[46/50] [abbrv] lucene-solr:jira/solr-8593: LUCENE-7496: Better toString for SweetSpotSimilarity

LUCENE-7496: Better toString for SweetSpotSimilarity


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

Branch: refs/heads/jira/solr-8593
Commit: c4b4830ac1c984e54e23c374ec7b83e598c7fc4b
Parents: 14b6d93
Author: Jan H�ydahl <ja...@apache.org>
Authored: Thu Oct 20 14:07:11 2016 +0200
Committer: Jan H�ydahl <ja...@apache.org>
Committed: Thu Oct 20 14:07:11 2016 +0200

----------------------------------------------------------------------
 lucene/CHANGES.txt                                  |  2 ++
 .../org/apache/lucene/misc/SweetSpotSimilarity.java | 16 ++++++++++++++++
 2 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c4b4830a/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 17e0b49..2bd4c28 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -109,6 +109,8 @@ Improvements
 * LUCENE-7439: FuzzyQuery now matches all terms within the specified
   edit distance, even if they are short terms (Mike McCandless)
 
+* LUCENE-7496: Better toString for SweetSpotSimilarity (janhoy)
+
 Optimizations
 
 * LUCENE-7501: BKDReader should not store the split dimension explicitly in the

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c4b4830a/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java b/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
index ce26080..7eeeae0 100644
--- a/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
+++ b/lucene/misc/src/java/org/apache/lucene/misc/SweetSpotSimilarity.java
@@ -223,4 +223,20 @@ public class SweetSpotSimilarity extends ClassicSimilarity {
     
   }
 
+  public String toString() {
+    StringBuilder sb = new StringBuilder();
+    sb.append("SweetSpotSimilarity")
+        .append("(")
+        .append("ln_min="+ln_min+", ")
+        .append("ln_max=").append(ln_max).append(", ")
+        .append("ln_steep=").append(ln_steep).append(", ")
+        .append("tf_base=").append(tf_base).append(", ")
+        .append("tf_min=").append(tf_min).append(", ")
+        .append("tf_hyper_min=").append(tf_hyper_min).append(", ")
+        .append("tf_hyper_max=").append(tf_hyper_max).append(", ")
+        .append("tf_hyper_base=").append(tf_hyper_base).append(", ")
+        .append("tf_hyper_xoffset=").append(tf_hyper_xoffset)
+        .append(")");
+    return sb.toString();
+  }
 }