From c4b4830ac1c984e54e23c374ec7b83e598c7fc4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Thu, 20 Oct 2016 14:07:11 +0200 Subject: [PATCH] LUCENE-7496: Better toString for SweetSpotSimilarity --- lucene/CHANGES.txt | 2 ++ .../apache/lucene/misc/SweetSpotSimilarity.java | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 17e0b49b91a..2bd4c2801ab 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 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 ce26080e45c..7eeeae0704d 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(); + } }