This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git


The following commit(s) were added to refs/heads/master by this push:
     new 70c6b8f  Don't insert extra newline in TFIDFSim's score explanation
70c6b8f is described below

commit 70c6b8fc090d91e337f419d57f0413c5af67d7e6
Author: Andre R <[email protected]>
AuthorDate: Thu Mar 11 11:31:27 2021 +0100

    Don't insert extra newline in TFIDFSim's score explanation
    
    Ref: 
https://github.com/apache/lucene-solr/commit/f0bfcbc7d8fbc5bb2791da60af559e8b0ad6eed6
---
 src/Lucene.Net/Search/Similarities/TFIDFSimilarity.cs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Lucene.Net/Search/Similarities/TFIDFSimilarity.cs 
b/src/Lucene.Net/Search/Similarities/TFIDFSimilarity.cs
index f7a5fe5..759fa78 100644
--- a/src/Lucene.Net/Search/Similarities/TFIDFSimilarity.cs
+++ b/src/Lucene.Net/Search/Similarities/TFIDFSimilarity.cs
@@ -751,7 +751,10 @@ namespace Lucene.Net.Search.Similarities
         private Explanation ExplainScore(int doc, Explanation freq, IDFStats 
stats, NumericDocValues norms)
         {
             Explanation result = new Explanation();
-            result.Description = "score(doc=" + doc + ",freq=" + freq + "), 
product of:";
+            // LUCENENET specific - using freq.Value is a change that was made 
in Lucene 5.0, but is included
+            // in 4.8.0 to remove annoying newlines from the output.
+            // See: 
https://github.com/apache/lucene-solr/commit/f0bfcbc7d8fbc5bb2791da60af559e8b0ad6eed6
+            result.Description = "score(doc=" + doc + ",freq=" + freq.Value + 
"), product of:";
 
             // explain query weight
             Explanation queryExpl = new Explanation();
@@ -803,4 +806,4 @@ namespace Lucene.Net.Search.Similarities
             return result;
         }
     }
-}
\ No newline at end of file
+}

Reply via email to